Changeset 3743 in subversion
- Timestamp:
- Jun 11, 2010 9:14:38 AM (3 years ago)
- Location:
- trunk/plugins/squirrelmail_usercopy
- Files:
-
- 2 edited
-
config.inc.php.dist (modified) (1 diff)
-
squirrelmail_usercopy.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/squirrelmail_usercopy/config.inc.php.dist
r3705 r3743 15 15 $rcmail_config['squirrelmail_userprefs_table'] = 'userprefs'; 16 16 17 // identities_level option value for squirrelmail plugin 18 // With this you can bypass/change identities_level checks 19 // for operations inside this plugin. See #1486773 20 $rcmail_config['squirrelmail_identities_level'] = null; 21 -
trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php
r3705 r3743 4 4 * Copy a new users identity and settings from a nearby Squirrelmail installation 5 5 * 6 * @version 1. 26 * @version 1.3 7 7 * @author Thomas Bruederli, Johannes Hessellund, pommi, Thomas Lueder 8 8 */ … … 18 18 { 19 19 $rcmail = rcmail::get_instance(); 20 $this->identities_level = intval($rcmail->config->get('identities_level', 0)); 20 21 // Set identities_level for operations of this plugin 22 $ilevel = $rcmail->config->get('squirrelmail_identities_level'); 23 if (!$ilevel === null) 24 $ilevel = $rcmail->config->get('identities_level', 0); 25 $this->identities_level = intval($ilevel); 21 26 22 27 $this->add_hook('create_user', array($this, 'create_user')); … … 28 33 // read prefs and add email address 29 34 $this->read_squirrel_prefs($p['user']); 30 if (($this->identities_level == 0 || $ identities_level == 2) && $this->prefs['email_address'])35 if (($this->identities_level == 0 || $this->identities_level == 2) && $this->prefs['email_address']) 31 36 $p['user_email'] = $this->prefs['email_address']; 32 37 return $p; … … 72 77 $contacts->insert($rec, true); 73 78 } 74 79 75 80 // mark identity as complete for following hooks 76 81 $p['complete'] = true; … … 93 98 $sigfile = slashify($srcdir) . $uname . '.sig'; 94 99 $sigbase = slashify($srcdir) . $uname . '.si'; 95 100 96 101 if (is_readable($prefsfile)) { 97 102 $this->prefs = array(); … … 108 113 if (isset($this->prefs['identities']) && $this->prefs['identities'] > 1) { 109 114 for ($i=1; $i < $this->prefs['identities']; $i++) { 110 // read signature file if exists 115 // read signature file if exists 111 116 if (is_readable($sigbase.$i)) { 112 117 $this->prefs['___sig'.$i.'___'] = utf8_encode(file_get_contents($sigbase.$i)); … … 134 139 135 140 // $db->set_debug(true); 136 141 137 142 /* retrieve prefs */ 138 143 $userprefs_table = $rcmail->config->get('squirrelmail_userprefs_table'); … … 151 156 /* retrieve address table data */ 152 157 $sql_result = $db->query('SELECT * FROM '.$address_table.' WHERE owner=?', $uname); // ? is replaced with emailaddress 153 158 154 159 // parse addres book 155 160 while ($sql_array = $db->fetch_assoc($sql_result) ) { // fetch one row from result … … 159 164 $rec['email'] = rcube_charset_convert(rtrim($sql_array['email']), $db_charset); 160 165 $rec['note'] = rcube_charset_convert(rtrim($sql_array['label']), $db_charset); 161 166 162 167 if ($rec['name'] && $rec['email']) 163 168 $this->abook[] = $rec; … … 167 172 168 173 } 169 170 ?>
Note: See TracChangeset
for help on using the changeset viewer.
