diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-22 17:38:30 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2010-09-22 17:38:30 +0000 |
| commit | c50b5351e2a2f8d49711edeca9a8b177779073ee (patch) | |
| tree | c24829a736f6c344d6fd88afef9ae43c84488c87 /plugins/squirrelmail_usercopy/squirrelmail_usercopy.php | |
| parent | 47b10335870d9be3d45401a9361f7b1636de16ac (diff) | |
Make alias setting configurable (patch by pommi) + fix indentation
git-svn-id: https://svn.roundcube.net/trunk@3986 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/squirrelmail_usercopy/squirrelmail_usercopy.php')
| -rw-r--r-- | plugins/squirrelmail_usercopy/squirrelmail_usercopy.php | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php index 990c79c14..82db3320e 100644 --- a/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php +++ b/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php @@ -22,12 +22,14 @@ class squirrelmail_usercopy extends rcube_plugin public function create_user($p) { - // Read plugin's config - $this->initialize(); + $rcmail = rcmail::get_instance(); + + // Read plugin's config + $this->initialize(); // read prefs and add email address $this->read_squirrel_prefs($p['user']); - if (($this->identities_level == 0 || $this->identities_level == 2) && $this->prefs['email_address']) + if (($this->identities_level == 0 || $this->identities_level == 2) && $rcmail->config->get('squirrelmail_set_alias') && $this->prefs['email_address']) $p['user_email'] = $this->prefs['email_address']; return $p; } @@ -83,16 +85,16 @@ class squirrelmail_usercopy extends rcube_plugin { $rcmail = rcmail::get_instance(); - // Load plugin's config file + // Load plugin's config file $this->load_config(); - // Set identities_level for operations of this plugin + // Set identities_level for operations of this plugin $ilevel = $rcmail->config->get('squirrelmail_identities_level'); - if ($ilevel === null) - $ilevel = $rcmail->config->get('identities_level', 0); + if ($ilevel === null) + $ilevel = $rcmail->config->get('identities_level', 0); - $this->identities_level = intval($ilevel); - } + $this->identities_level = intval($ilevel); + } private function read_squirrel_prefs($uname) { @@ -153,8 +155,8 @@ class squirrelmail_usercopy extends rcube_plugin $address_table = $rcmail->config->get('squirrelmail_address_table'); $db_charset = $rcmail->config->get('squirrelmail_db_charset'); - if ($db_charset) - $db->query('SET NAMES '.$db_charset); + if ($db_charset) + $db->query('SET NAMES '.$db_charset); $sql_result = $db->query('SELECT * FROM '.$userprefs_table.' WHERE user=?', $uname); // ? is replaced with emailaddress |
