[Svn] r3986 - trunk/plugins/squirrelmail_usercopy

trac at roundcube.net trac at roundcube.net
Wed Sep 22 19:38:30 CEST 2010


Author: thomasb
Date: 2010-09-22 12:38:30 -0500 (Wed, 22 Sep 2010)
New Revision: 3986

Modified:
   trunk/plugins/squirrelmail_usercopy/config.inc.php.dist
   trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php
Log:
Make alias setting configurable (patch by pommi) + fix indentation

Modified: trunk/plugins/squirrelmail_usercopy/config.inc.php.dist
===================================================================
--- trunk/plugins/squirrelmail_usercopy/config.inc.php.dist	2010-09-22 17:00:53 UTC (rev 3985)
+++ trunk/plugins/squirrelmail_usercopy/config.inc.php.dist	2010-09-22 17:38:30 UTC (rev 3986)
@@ -19,3 +19,7 @@
 // for operations inside this plugin. See #1486773
 $rcmail_config['squirrelmail_identities_level'] = null;
 
+// Set to false if you don't want the email address of the default identity
+// (squirrelmail preference "email_address") to be saved as alias.
+// Recommended: set to false if your squirrelmail config setting $edit_identity has been true.
+$rcmail_config['squirrelmail_set_alias'] = true;

Modified: trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php
===================================================================
--- trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php	2010-09-22 17:00:53 UTC (rev 3985)
+++ trunk/plugins/squirrelmail_usercopy/squirrelmail_usercopy.php	2010-09-22 17:38:30 UTC (rev 3986)
@@ -22,12 +22,14 @@
 
 	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 @@
 	{
 		$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 @@
 			$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
 

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



More information about the Svn mailing list