Changeset 3986 in subversion


Ignore:
Timestamp:
Sep 22, 2010 1:38:30 PM (3 years ago)
Author:
thomasb
Message:

Make alias setting configurable (patch by pommi) + fix indentation

Location:
trunk/plugins/squirrelmail_usercopy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/squirrelmail_usercopy/config.inc.php.dist

    r3743 r3986  
    2020$rcmail_config['squirrelmail_identities_level'] = null; 
    2121 
     22// Set to false if you don't want the email address of the default identity 
     23// (squirrelmail preference "email_address") to be saved as alias. 
     24// Recommended: set to false if your squirrelmail config setting $edit_identity has been true. 
     25$rcmail_config['squirrelmail_set_alias'] = true; 
  • trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php

    r3985 r3986  
    2323        public function create_user($p) 
    2424        { 
    25         // Read plugin's config 
    26         $this->initialize(); 
     25                $rcmail = rcmail::get_instance(); 
     26 
     27                // Read plugin's config 
     28                $this->initialize(); 
    2729 
    2830                // read prefs and add email address 
    2931                $this->read_squirrel_prefs($p['user']); 
    30                 if (($this->identities_level == 0 || $this->identities_level == 2) && $this->prefs['email_address']) 
     32                if (($this->identities_level == 0 || $this->identities_level == 2) && $rcmail->config->get('squirrelmail_set_alias') && $this->prefs['email_address']) 
    3133                        $p['user_email'] = $this->prefs['email_address']; 
    3234                return $p; 
     
    8486                $rcmail = rcmail::get_instance(); 
    8587 
    86         // Load plugin's config file 
     88                // Load plugin's config file 
    8789                $this->load_config(); 
    8890 
    89         // Set identities_level for operations of this plugin 
     91                // Set identities_level for operations of this plugin 
    9092                $ilevel = $rcmail->config->get('squirrelmail_identities_level'); 
    91         if ($ilevel === null) 
    92                     $ilevel = $rcmail->config->get('identities_level', 0); 
     93                if ($ilevel === null) 
     94                        $ilevel = $rcmail->config->get('identities_level', 0); 
    9395 
    94         $this->identities_level = intval($ilevel); 
    95     } 
     96                $this->identities_level = intval($ilevel); 
     97        } 
    9698 
    9799        private function read_squirrel_prefs($uname) 
     
    154156                        $db_charset = $rcmail->config->get('squirrelmail_db_charset'); 
    155157 
    156             if ($db_charset) 
    157                         $db->query('SET NAMES '.$db_charset); 
     158                        if ($db_charset) 
     159                                $db->query('SET NAMES '.$db_charset); 
    158160 
    159161                        $sql_result = $db->query('SELECT * FROM '.$userprefs_table.' WHERE user=?', $uname); // ? is replaced with emailaddress 
Note: See TracChangeset for help on using the changeset viewer.