[Svn] r3983 - trunk/plugins/squirrelmail_usercopy

trac at roundcube.net trac at roundcube.net
Wed Sep 22 13:00:27 CEST 2010


Author: alec
Date: 2010-09-22 06:00:27 -0500 (Wed, 22 Sep 2010)
New Revision: 3983

Modified:
   trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php
Log:
- Squirrelmail_usercopy: Fix identities_level setting (#1487006)


Modified: trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php
===================================================================
--- trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php	2010-09-21 18:47:55 UTC (rev 3982)
+++ trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php	2010-09-22 11:00:27 UTC (rev 3983)
@@ -16,20 +16,15 @@
 
 	public function init()
 	{
-		$rcmail = rcmail::get_instance();
-
-        // 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);
-        $this->identities_level = intval($ilevel);
-
 		$this->add_hook('user_create', array($this, 'create_user'));
 		$this->add_hook('identity_create', array($this, 'create_identity'));
 	}
 
 	public function create_user($p)
 	{
+        // 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'])
@@ -84,9 +79,23 @@
 		return $p;
 	}
 
+	private function initialize()
+	{
+		$rcmail = rcmail::get_instance();
+
+        // Load plugin's config file
+		$this->load_config();
+
+        // 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);
+
+        $this->identities_level = intval($ilevel);
+    }
+
 	private function read_squirrel_prefs($uname)
 	{
-		$this->load_config();
 		$rcmail = rcmail::get_instance();
 
 		/**** File based backend ****/

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list