Completed
Push — 16.1 ( 05bf72...884fd0 )
by Hadi
27:28 queued 10:22
created
api/setup/tables_update.inc.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	$tables = $GLOBALS['egw_setup']->db->table_names(true);
27 27
 	$phpgw_baseline = array();
28 28
 	include (__DIR__.'/tables_current.inc.php');
29
-	foreach($phpgw_baseline as $table => $definition)
29
+	foreach ($phpgw_baseline as $table => $definition)
30 30
 	{
31 31
 		if (!in_array($table, $tables))
32 32
 		{
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
 	// uninstall obsolete FelamiMail tables, if still around
45 45
 	$done = 0;
46
-	foreach(array_intersect($tables, array('egw_felamimail_accounts', 'egw_felamimail_displayfilter', 'egw_felamimail_signatures')) as $table)
46
+	foreach (array_intersect($tables, array('egw_felamimail_accounts', 'egw_felamimail_displayfilter', 'egw_felamimail_signatures')) as $table)
47 47
 	{
48 48
 		$GLOBALS['egw_setup']->oProc->DropTable($table);
49 49
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
  */
61 61
 function api_upgrade16_1()
62 62
 {
63
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_folder_archive', array(
63
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts', 'acc_folder_archive', array(
64 64
 		'type' => 'varchar',
65 65
 		'precision' => '128',
66 66
 		'comment' => 'archive folder'
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function api_upgrade16_1_001()
78 78
 {
79
-	foreach(array(
79
+	foreach (array(
80 80
 		'cf_type' => 'egw_customfields',
81 81
 		'link_app1' => 'egw_links',
82 82
 		'link_app2' => 'egw_links',
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
  */
101 101
 function api_upgrade16_1_002()
102 102
 {
103
-	$admins = $GLOBALS['egw_setup']->add_account('Admins','Admin','Group',False,False);
103
+	$admins = $GLOBALS['egw_setup']->add_account('Admins', 'Admin', 'Group', False, False);
104 104
 
105 105
 	Vfs::$is_root = true;
106
-	foreach(array('','addressbook', 'calendar', 'infolog', 'tracker', 'timesheet', 'projectmanager', 'filemanager') as $app)
106
+	foreach (array('', 'addressbook', 'calendar', 'infolog', 'tracker', 'timesheet', 'projectmanager', 'filemanager') as $app)
107 107
 	{
108 108
 		if ($app && !file_exists(EGW_SERVER_ROOT.'/'.$app)) continue;
109 109
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 function api_upgrade16_1_003()
129 129
 {
130 130
 	$GLOBALS['egw_setup']->oProc->RenameColumn('egw_ea_accounts', 'acc_further_identities', 'further_bool');
131
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_further_identities',array(
131
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts', 'acc_further_identities', array(
132 132
 		'type' => 'int',
133 133
 		'precision' => '1',
134 134
 		'nullable' => False,
@@ -162,19 +162,19 @@  discard block
 block discarded – undo
162 162
 		$total = 0;
163 163
 		do {
164 164
 			$n = 0;
165
-			foreach($GLOBALS['egw_setup']->db->query('SELECT fs_id,prop_namespace,prop_name,MAX(prop_id) AS prop_id
165
+			foreach ($GLOBALS['egw_setup']->db->query('SELECT fs_id,prop_namespace,prop_name,MAX(prop_id) AS prop_id
166 166
 FROM egw_sqlfs_props
167 167
 GROUP BY fs_id,prop_namespace,prop_name
168 168
 HAVING COUNT(*) > 1', __LINE__, __FILE__, 0, $junk_size, false, Api\Db::FETCH_ASSOC) as $row)
169 169
 			{
170 170
 				$prop_id = $row['prop_id'];
171 171
 				unset($row['prop_id']);
172
-				$GLOBALS['egw_setup']->db->delete('egw_sqlfs_props', $row+array('prop_id != '.(int)$prop_id), __LINE__, __FILE__);
172
+				$GLOBALS['egw_setup']->db->delete('egw_sqlfs_props', $row + array('prop_id != '.(int)$prop_id), __LINE__, __FILE__);
173 173
 				$total += $GLOBALS['egw_setup']->db->affected_rows();
174 174
 				$n++;
175 175
 			}
176 176
 		}
177
-		while($n == $junk_size);
177
+		while ($n == $junk_size);
178 178
 
179 179
 		if ($total)
180 180
 		{
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
  */
211 211
 function api_upgrade16_9()
212 212
 {
213
-	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_ea_credentials','cred_password',array(
213
+	$GLOBALS['egw_setup']->oProc->AlterColumn('egw_ea_credentials', 'cred_password', array(
214 214
 		'type' => 'varchar',
215 215
 		'precision' => '9600',
216 216
 		'comment' => 'password encrypted'
@@ -221,12 +221,12 @@  discard block
 block discarded – undo
221 221
 
222 222
 function api_upgrade16_9_001()
223 223
 {
224
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_folder_ham',array(
224
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts', 'acc_folder_ham', array(
225 225
 		'type' => 'varchar',
226 226
 		'precision' => '128',
227 227
 		'comment' => 'ham folder'
228 228
 	));
229
-	$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts','acc_spam_api',array(
229
+	$GLOBALS['egw_setup']->oProc->AddColumn('egw_ea_accounts', 'acc_spam_api', array(
230 230
 		'type' => 'varchar',
231 231
 		'precision' => '128',
232 232
 		'comment' => 'SpamTitan API URL'
Please login to merge, or discard this patch.
api/setup/tables_current.inc.php 1 patch
Spacing   +304 added lines, -304 removed lines patch added patch discarded remove patch
@@ -14,58 +14,58 @@  discard block
 block discarded – undo
14 14
 $phpgw_baseline = array(
15 15
 	'egw_config' => array(
16 16
 		'fd' => array(
17
-			'config_app' => array('type' => 'ascii','precision' => '16','nullable' => False),
18
-			'config_name' => array('type' => 'ascii','precision' => '32','nullable' => False),
17
+			'config_app' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False),
18
+			'config_name' => array('type' => 'ascii', 'precision' => '32', 'nullable' => False),
19 19
 			'config_value' => array('type' => 'text')
20 20
 		),
21
-		'pk' => array('config_app','config_name'),
21
+		'pk' => array('config_app', 'config_name'),
22 22
 		'fk' => array(),
23 23
 		'ix' => array(),
24 24
 		'uc' => array()
25 25
 	),
26 26
 	'egw_applications' => array(
27 27
 		'fd' => array(
28
-			'app_id' => array('type' => 'auto','precision' => '4','nullable' => False),
29
-			'app_name' => array('type' => 'ascii','precision' => '16','nullable' => False),
30
-			'app_enabled' => array('type' => 'int','precision' => '4','nullable' => False),
31
-			'app_order' => array('type' => 'int','precision' => '4','nullable' => False),
32
-			'app_tables' => array('type' => 'ascii','precision' => '8192','nullable' => False),
33
-			'app_version' => array('type' => 'ascii','precision' => '20','nullable' => False,'default' => '0.0'),
34
-			'app_icon' => array('type' => 'ascii','precision' => '32'),
35
-			'app_icon_app' => array('type' => 'ascii','precision' => '16'),
36
-			'app_index' => array('type' => 'ascii','precision' => '64')
28
+			'app_id' => array('type' => 'auto', 'precision' => '4', 'nullable' => False),
29
+			'app_name' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False),
30
+			'app_enabled' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
31
+			'app_order' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
32
+			'app_tables' => array('type' => 'ascii', 'precision' => '8192', 'nullable' => False),
33
+			'app_version' => array('type' => 'ascii', 'precision' => '20', 'nullable' => False, 'default' => '0.0'),
34
+			'app_icon' => array('type' => 'ascii', 'precision' => '32'),
35
+			'app_icon_app' => array('type' => 'ascii', 'precision' => '16'),
36
+			'app_index' => array('type' => 'ascii', 'precision' => '64')
37 37
 		),
38 38
 		'pk' => array('app_id'),
39 39
 		'fk' => array(),
40
-		'ix' => array(array('app_enabled','app_order')),
40
+		'ix' => array(array('app_enabled', 'app_order')),
41 41
 		'uc' => array('app_name')
42 42
 	),
43 43
 	'egw_acl' => array(
44 44
 		'fd' => array(
45
-			'acl_appname' => array('type' => 'ascii','precision' => '16','nullable' => False),
46
-			'acl_location' => array('type' => 'ascii','meta' => 'account','precision' => '16','nullable' => False),
47
-			'acl_account' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False),
48
-			'acl_rights' => array('type' => 'int','precision' => '4'),
49
-			'acl_id' => array('type' => 'auto','nullable' => False)
45
+			'acl_appname' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False),
46
+			'acl_location' => array('type' => 'ascii', 'meta' => 'account', 'precision' => '16', 'nullable' => False),
47
+			'acl_account' => array('type' => 'int', 'meta' => 'account', 'precision' => '4', 'nullable' => False),
48
+			'acl_rights' => array('type' => 'int', 'precision' => '4'),
49
+			'acl_id' => array('type' => 'auto', 'nullable' => False)
50 50
 		),
51 51
 		'pk' => array('acl_id'),
52 52
 		'fk' => array(),
53
-		'ix' => array('acl_account',array('acl_location','acl_account'),array('acl_appname','acl_account')),
54
-		'uc' => array(array('acl_appname','acl_location','acl_account'))
53
+		'ix' => array('acl_account', array('acl_location', 'acl_account'), array('acl_appname', 'acl_account')),
54
+		'uc' => array(array('acl_appname', 'acl_location', 'acl_account'))
55 55
 	),
56 56
 	'egw_accounts' => array(
57 57
 		'fd' => array(
58
-			'account_id' => array('type' => 'auto','meta' => 'account-abs','nullable' => False),
59
-			'account_lid' => array('type' => 'varchar','precision' => '64','nullable' => False),
60
-			'account_pwd' => array('type' => 'varchar','precision' => '128','nullable' => False),
61
-			'account_lastlogin' => array('type' => 'int','precision' => '4'),
62
-			'account_lastloginfrom' => array('type' => 'ascii','precision' => '48','comment' => 'ip'),
63
-			'account_lastpwd_change' => array('type' => 'int','precision' => '4'),
64
-			'account_status' => array('type' => 'char','precision' => '1','nullable' => False,'default' => 'A'),
65
-			'account_expires' => array('type' => 'int','precision' => '4'),
66
-			'account_type' => array('type' => 'char','precision' => '1'),
67
-			'account_primary_group' => array('type' => 'int','meta' => 'group','precision' => '4','nullable' => False,'default' => '0'),
68
-			'account_description' => array('type' => 'varchar','precision' => '255','comment' => 'group description')
58
+			'account_id' => array('type' => 'auto', 'meta' => 'account-abs', 'nullable' => False),
59
+			'account_lid' => array('type' => 'varchar', 'precision' => '64', 'nullable' => False),
60
+			'account_pwd' => array('type' => 'varchar', 'precision' => '128', 'nullable' => False),
61
+			'account_lastlogin' => array('type' => 'int', 'precision' => '4'),
62
+			'account_lastloginfrom' => array('type' => 'ascii', 'precision' => '48', 'comment' => 'ip'),
63
+			'account_lastpwd_change' => array('type' => 'int', 'precision' => '4'),
64
+			'account_status' => array('type' => 'char', 'precision' => '1', 'nullable' => False, 'default' => 'A'),
65
+			'account_expires' => array('type' => 'int', 'precision' => '4'),
66
+			'account_type' => array('type' => 'char', 'precision' => '1'),
67
+			'account_primary_group' => array('type' => 'int', 'meta' => 'group', 'precision' => '4', 'nullable' => False, 'default' => '0'),
68
+			'account_description' => array('type' => 'varchar', 'precision' => '255', 'comment' => 'group description')
69 69
 		),
70 70
 		'pk' => array('account_id'),
71 71
 		'fk' => array(),
@@ -74,39 +74,39 @@  discard block
 block discarded – undo
74 74
 	),
75 75
 	'egw_preferences' => array(
76 76
 		'fd' => array(
77
-			'preference_owner' => array('type' => 'int','meta' => 'account-prefs','precision' => '4','nullable' => False),
78
-			'preference_app' => array('type' => 'ascii','precision' => '16','nullable' => False),
79
-			'preference_value' => array('type' => 'text','nullable' => False),
80
-			'preference_id' => array('type' => 'auto','nullable' => False)
77
+			'preference_owner' => array('type' => 'int', 'meta' => 'account-prefs', 'precision' => '4', 'nullable' => False),
78
+			'preference_app' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False),
79
+			'preference_value' => array('type' => 'text', 'nullable' => False),
80
+			'preference_id' => array('type' => 'auto', 'nullable' => False)
81 81
 		),
82 82
 		'pk' => array('preference_id'),
83 83
 		'fk' => array(),
84 84
 		'ix' => array(),
85
-		'uc' => array(array('preference_owner','preference_app'))
85
+		'uc' => array(array('preference_owner', 'preference_app'))
86 86
 	),
87 87
 	'egw_access_log' => array(
88 88
 		'fd' => array(
89
-			'sessionid' => array('type' => 'auto','nullable' => False,'comment' => 'primary key'),
90
-			'loginid' => array('type' => 'varchar','precision' => '64','nullable' => False,'comment' => 'username used to login'),
91
-			'ip' => array('type' => 'ascii','precision' => '48','nullable' => False,'comment' => 'ip of user'),
92
-			'li' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'TS if login'),
93
-			'lo' => array('type' => 'int','meta' => 'timestamp','precision' => '8','comment' => 'TD of logout'),
94
-			'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'default' => '0','comment' => 'numerical account id'),
95
-			'session_dla' => array('type' => 'int','meta' => 'timestamp','precision' => '8','comment' => 'TS of last user action'),
96
-			'session_action' => array('type' => 'ascii','precision' => '64','comment' => 'menuaction or path of last user action'),
97
-			'session_php' => array('type' => 'ascii','precision' => '64','nullable' => False,'comment' => 'php session-id or error-message'),
98
-			'notification_heartbeat' => array('type' => 'int','meta' => 'timestamp','precision' => '8','comment' => 'TS of last notification request'),
99
-			'user_agent' => array('type' => 'ascii','precision' => '255','comment' => 'User-agent of browser/device')
89
+			'sessionid' => array('type' => 'auto', 'nullable' => False, 'comment' => 'primary key'),
90
+			'loginid' => array('type' => 'varchar', 'precision' => '64', 'nullable' => False, 'comment' => 'username used to login'),
91
+			'ip' => array('type' => 'ascii', 'precision' => '48', 'nullable' => False, 'comment' => 'ip of user'),
92
+			'li' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'comment' => 'TS if login'),
93
+			'lo' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'comment' => 'TD of logout'),
94
+			'account_id' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'default' => '0', 'comment' => 'numerical account id'),
95
+			'session_dla' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'comment' => 'TS of last user action'),
96
+			'session_action' => array('type' => 'ascii', 'precision' => '64', 'comment' => 'menuaction or path of last user action'),
97
+			'session_php' => array('type' => 'ascii', 'precision' => '64', 'nullable' => False, 'comment' => 'php session-id or error-message'),
98
+			'notification_heartbeat' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'comment' => 'TS of last notification request'),
99
+			'user_agent' => array('type' => 'ascii', 'precision' => '255', 'comment' => 'User-agent of browser/device')
100 100
 		),
101 101
 		'pk' => array('sessionid'),
102 102
 		'fk' => array(),
103
-		'ix' => array('li','lo','session_dla','session_php','notification_heartbeat',array('account_id','ip','li'),array('account_id','loginid','li')),
103
+		'ix' => array('li', 'lo', 'session_dla', 'session_php', 'notification_heartbeat', array('account_id', 'ip', 'li'), array('account_id', 'loginid', 'li')),
104 104
 		'uc' => array()
105 105
 	),
106 106
 	'egw_languages' => array(
107 107
 		'fd' => array(
108
-			'lang_id' => array('type' => 'ascii','precision' => '5','nullable' => False),
109
-			'lang_name' => array('type' => 'varchar','precision' => '50','nullable' => False)
108
+			'lang_id' => array('type' => 'ascii', 'precision' => '5', 'nullable' => False),
109
+			'lang_name' => array('type' => 'varchar', 'precision' => '50', 'nullable' => False)
110 110
 		),
111 111
 		'pk' => array('lang_id'),
112 112
 		'fk' => array(),
@@ -115,62 +115,62 @@  discard block
 block discarded – undo
115 115
 	),
116 116
 	'egw_lang' => array(
117 117
 		'fd' => array(
118
-			'lang' => array('type' => 'varchar','precision' => '5','nullable' => False,'default' => ''),
119
-			'app_name' => array('type' => 'ascii','precision' => '16','nullable' => False,'default' => 'common'),
120
-			'message_id' => array('type' => 'ascii','precision' => '128','nullable' => False,'default' => ''),
121
-			'content' => array('type' => 'varchar','precision' => '8192'),
122
-			'lang_id' => array('type' => 'auto','nullable' => False)
118
+			'lang' => array('type' => 'varchar', 'precision' => '5', 'nullable' => False, 'default' => ''),
119
+			'app_name' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False, 'default' => 'common'),
120
+			'message_id' => array('type' => 'ascii', 'precision' => '128', 'nullable' => False, 'default' => ''),
121
+			'content' => array('type' => 'varchar', 'precision' => '8192'),
122
+			'lang_id' => array('type' => 'auto', 'nullable' => False)
123 123
 		),
124 124
 		'pk' => array('lang_id'),
125 125
 		'fk' => array(),
126 126
 		'ix' => array(),
127
-		'uc' => array(array('lang','app_name','message_id'))
127
+		'uc' => array(array('lang', 'app_name', 'message_id'))
128 128
 	),
129 129
 	'egw_categories' => array(
130 130
 		'fd' => array(
131
-			'cat_id' => array('type' => 'auto','meta' => 'category','precision' => '4','nullable' => False),
132
-			'cat_main' => array('type' => 'int','meta' => 'category','precision' => '4','nullable' => False,'default' => '0'),
133
-			'cat_parent' => array('type' => 'int','meta' => 'category','precision' => '4','nullable' => False,'default' => '0'),
134
-			'cat_level' => array('type' => 'int','precision' => '2','nullable' => False,'default' => '0'),
135
-			'cat_owner' => array('type' => 'ascii','meta' => 'account-commasep','precision' => '255','nullable' => False,'default' => '0'),
136
-			'cat_access' => array('type' => 'ascii','precision' => '7'),
137
-			'cat_appname' => array('type' => 'ascii','precision' => '16','nullable' => False),
138
-			'cat_name' => array('type' => 'varchar','precision' => '150','nullable' => False),
139
-			'cat_description' => array('type' => 'varchar','precision' => '255','nullable' => False),
140
-			'cat_data' => array('type' => 'varchar','precision' => '8192'),
141
-			'last_mod' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False)
131
+			'cat_id' => array('type' => 'auto', 'meta' => 'category', 'precision' => '4', 'nullable' => False),
132
+			'cat_main' => array('type' => 'int', 'meta' => 'category', 'precision' => '4', 'nullable' => False, 'default' => '0'),
133
+			'cat_parent' => array('type' => 'int', 'meta' => 'category', 'precision' => '4', 'nullable' => False, 'default' => '0'),
134
+			'cat_level' => array('type' => 'int', 'precision' => '2', 'nullable' => False, 'default' => '0'),
135
+			'cat_owner' => array('type' => 'ascii', 'meta' => 'account-commasep', 'precision' => '255', 'nullable' => False, 'default' => '0'),
136
+			'cat_access' => array('type' => 'ascii', 'precision' => '7'),
137
+			'cat_appname' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False),
138
+			'cat_name' => array('type' => 'varchar', 'precision' => '150', 'nullable' => False),
139
+			'cat_description' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False),
140
+			'cat_data' => array('type' => 'varchar', 'precision' => '8192'),
141
+			'last_mod' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False)
142 142
 		),
143 143
 		'pk' => array('cat_id'),
144 144
 		'fk' => array(),
145
-		'ix' => array(array('cat_appname','cat_owner','cat_parent','cat_level')),
145
+		'ix' => array(array('cat_appname', 'cat_owner', 'cat_parent', 'cat_level')),
146 146
 		'uc' => array()
147 147
 	),
148 148
 	'egw_history_log' => array(
149 149
 		'fd' => array(
150
-			'history_id' => array('type' => 'auto','precision' => '4','nullable' => False),
151
-			'history_record_id' => array('type' => 'int','precision' => '4','nullable' => False),
152
-			'history_appname' => array('type' => 'ascii','precision' => '16','nullable' => False),
153
-			'history_owner' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False),
154
-			'history_status' => array('type' => 'varchar','precision' => '32','nullable' => False),
155
-			'history_new_value' => array('type' => 'text','nullable' => False),
156
-			'history_timestamp' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'),
157
-			'history_old_value' => array('type' => 'text','nullable' => False),
158
-			'sessionid' => array('type' => 'int','precision' => '4','comment' => 'primary key to egw_access_log')
150
+			'history_id' => array('type' => 'auto', 'precision' => '4', 'nullable' => False),
151
+			'history_record_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
152
+			'history_appname' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False),
153
+			'history_owner' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False),
154
+			'history_status' => array('type' => 'varchar', 'precision' => '32', 'nullable' => False),
155
+			'history_new_value' => array('type' => 'text', 'nullable' => False),
156
+			'history_timestamp' => array('type' => 'timestamp', 'nullable' => False, 'default' => 'current_timestamp'),
157
+			'history_old_value' => array('type' => 'text', 'nullable' => False),
158
+			'sessionid' => array('type' => 'int', 'precision' => '4', 'comment' => 'primary key to egw_access_log')
159 159
 		),
160 160
 		'pk' => array('history_id'),
161 161
 		'fk' => array(),
162
-		'ix' => array(array('history_appname','history_record_id','history_id')),
162
+		'ix' => array(array('history_appname', 'history_record_id', 'history_id')),
163 163
 		'uc' => array()
164 164
 	),
165 165
 	'egw_async' => array(
166 166
 		'fd' => array(
167
-			'async_id' => array('type' => 'ascii','precision' => '64','nullable' => False),
168
-			'async_next' => array('type' => 'int','meta' => 'timestamp','precision' => '4','nullable' => False,'comment' => 'timestamp of next run'),
169
-			'async_times' => array('type' => 'ascii','precision' => '255','nullable' => False,'comment' => 'serialized array with values for keys hour,min,day,month,year'),
170
-			'async_method' => array('type' => 'ascii','precision' => '80','nullable' => False,'comment' => 'app.class.method class::method to execute'),
171
-			'async_data' => array('type' => 'varchar','precision' => '8192','nullable' => False,'comment' => 'serialized array with data to pass to method'),
172
-			'async_account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'default' => '0','comment' => 'creator of job'),
173
-			'async_auto_id' => array('type' => 'auto','nullable' => False)
167
+			'async_id' => array('type' => 'ascii', 'precision' => '64', 'nullable' => False),
168
+			'async_next' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '4', 'nullable' => False, 'comment' => 'timestamp of next run'),
169
+			'async_times' => array('type' => 'ascii', 'precision' => '255', 'nullable' => False, 'comment' => 'serialized array with values for keys hour,min,day,month,year'),
170
+			'async_method' => array('type' => 'ascii', 'precision' => '80', 'nullable' => False, 'comment' => 'app.class.method class::method to execute'),
171
+			'async_data' => array('type' => 'varchar', 'precision' => '8192', 'nullable' => False, 'comment' => 'serialized array with data to pass to method'),
172
+			'async_account_id' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'default' => '0', 'comment' => 'creator of job'),
173
+			'async_auto_id' => array('type' => 'auto', 'nullable' => False)
174 174
 		),
175 175
 		'pk' => array('async_auto_id'),
176 176
 		'fk' => array(),
@@ -179,226 +179,226 @@  discard block
 block discarded – undo
179 179
 	),
180 180
 	'egw_links' => array(
181 181
 		'fd' => array(
182
-			'link_id' => array('type' => 'auto','nullable' => False),
183
-			'link_app1' => array('type' => 'ascii','precision' => '16','nullable' => False),
184
-			'link_id1' => array('type' => 'ascii','meta' => array("link_app1='api-accounts'" => 'account'),'precision' => '64','nullable' => False),
185
-			'link_app2' => array('type' => 'ascii','precision' => '16','nullable' => False),
186
-			'link_id2' => array('type' => 'ascii','meta' => array("link_app2='api-accounts'" => 'account'),'precision' => '64','nullable' => False),
187
-			'link_remark' => array('type' => 'varchar','precision' => '100'),
188
-			'link_lastmod' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False),
189
-			'link_owner' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False),
182
+			'link_id' => array('type' => 'auto', 'nullable' => False),
183
+			'link_app1' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False),
184
+			'link_id1' => array('type' => 'ascii', 'meta' => array("link_app1='api-accounts'" => 'account'), 'precision' => '64', 'nullable' => False),
185
+			'link_app2' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False),
186
+			'link_id2' => array('type' => 'ascii', 'meta' => array("link_app2='api-accounts'" => 'account'), 'precision' => '64', 'nullable' => False),
187
+			'link_remark' => array('type' => 'varchar', 'precision' => '100'),
188
+			'link_lastmod' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False),
189
+			'link_owner' => array('type' => 'int', 'meta' => 'account', 'precision' => '4', 'nullable' => False),
190 190
 			'deleted' => array('type' => 'timestamp')
191 191
 		),
192 192
 		'pk' => array('link_id'),
193 193
 		'fk' => array(),
194
-		'ix' => array('deleted',array('link_app1','link_id1','link_lastmod'),array('link_app2','link_id2','link_lastmod')),
194
+		'ix' => array('deleted', array('link_app1', 'link_id1', 'link_lastmod'), array('link_app2', 'link_id2', 'link_lastmod')),
195 195
 		'uc' => array()
196 196
 	),
197 197
 	'egw_addressbook' => array(
198 198
 		'fd' => array(
199
-			'contact_id' => array('type' => 'auto','nullable' => False),
200
-			'contact_tid' => array('type' => 'char','precision' => '1','default' => 'n'),
201
-			'contact_owner' => array('type' => 'int','meta' => 'account','precision' => '8','nullable' => False,'comment' => 'account or group id of the adressbook'),
202
-			'contact_private' => array('type' => 'int','precision' => '1','default' => '0','comment' => 'privat or personal'),
203
-			'cat_id' => array('type' => 'ascii','meta' => 'category','precision' => '255','comment' => 'Category(s)'),
204
-			'n_family' => array('type' => 'varchar','precision' => '64','comment' => 'Family name'),
205
-			'n_given' => array('type' => 'varchar','precision' => '64','comment' => 'Given Name'),
206
-			'n_middle' => array('type' => 'varchar','precision' => '64'),
207
-			'n_prefix' => array('type' => 'varchar','precision' => '64','comment' => 'Prefix'),
208
-			'n_suffix' => array('type' => 'varchar','precision' => '64','comment' => 'Suffix'),
209
-			'n_fn' => array('type' => 'varchar','precision' => '128','comment' => 'Full name'),
210
-			'n_fileas' => array('type' => 'varchar','precision' => '255','comment' => 'sort as'),
211
-			'contact_bday' => array('type' => 'varchar','precision' => '12','comment' => 'Birtday'),
212
-			'org_name' => array('type' => 'varchar','precision' => '128','comment' => 'Organisation'),
213
-			'org_unit' => array('type' => 'varchar','precision' => '64','comment' => 'Department'),
214
-			'contact_title' => array('type' => 'varchar','precision' => '64','comment' => 'jobtittle'),
215
-			'contact_role' => array('type' => 'varchar','precision' => '64','comment' => 'role'),
216
-			'contact_assistent' => array('type' => 'varchar','precision' => '64','comment' => 'Name of the Assistent (for phone number)'),
217
-			'contact_room' => array('type' => 'varchar','precision' => '64','comment' => 'room'),
218
-			'adr_one_street' => array('type' => 'varchar','precision' => '64','comment' => 'street (business)'),
219
-			'adr_one_street2' => array('type' => 'varchar','precision' => '64','comment' => 'street (business) - 2. line'),
220
-			'adr_one_locality' => array('type' => 'varchar','precision' => '64','comment' => 'city (business)'),
221
-			'adr_one_region' => array('type' => 'varchar','precision' => '64','comment' => 'region (business)'),
222
-			'adr_one_postalcode' => array('type' => 'varchar','precision' => '64','comment' => 'postalcode (business)'),
223
-			'adr_one_countryname' => array('type' => 'varchar','precision' => '64','comment' => 'countryname (business)'),
224
-			'contact_label' => array('type' => 'text','comment' => 'currently not used'),
225
-			'adr_two_street' => array('type' => 'varchar','precision' => '64','comment' => 'street (private)'),
226
-			'adr_two_street2' => array('type' => 'varchar','precision' => '64','comment' => 'street (private) - 2. line'),
227
-			'adr_two_locality' => array('type' => 'varchar','precision' => '64','comment' => 'city (private)'),
228
-			'adr_two_region' => array('type' => 'varchar','precision' => '64','comment' => 'region (private)'),
229
-			'adr_two_postalcode' => array('type' => 'varchar','precision' => '64','comment' => 'postalcode (private)'),
230
-			'adr_two_countryname' => array('type' => 'varchar','precision' => '64','comment' => 'countryname (private)'),
231
-			'tel_work' => array('type' => 'varchar','precision' => '40','comment' => 'phone-number (business)'),
232
-			'tel_cell' => array('type' => 'varchar','precision' => '40','comment' => 'mobil phone (business)'),
233
-			'tel_fax' => array('type' => 'varchar','precision' => '40','comment' => 'fax-number (business)'),
234
-			'tel_assistent' => array('type' => 'varchar','precision' => '40','comment' => 'phone-number assistent'),
235
-			'tel_car' => array('type' => 'varchar','precision' => '40'),
236
-			'tel_pager' => array('type' => 'varchar','precision' => '40','comment' => 'pager'),
237
-			'tel_home' => array('type' => 'varchar','precision' => '40','comment' => 'phone-number (private)'),
238
-			'tel_fax_home' => array('type' => 'varchar','precision' => '40','comment' => 'fax-number (private)'),
239
-			'tel_cell_private' => array('type' => 'varchar','precision' => '40','comment' => 'mobil phone (private)'),
240
-			'tel_other' => array('type' => 'varchar','precision' => '40','comment' => 'other phone'),
241
-			'tel_prefer' => array('type' => 'varchar','precision' => '32','comment' => 'prefered phone-number'),
242
-			'contact_email' => array('type' => 'varchar','precision' => '128','comment' => 'email address (business)'),
243
-			'contact_email_home' => array('type' => 'varchar','precision' => '128','comment' => 'email address (private)'),
244
-			'contact_url' => array('type' => 'varchar','precision' => '128','comment' => 'website (business)'),
245
-			'contact_url_home' => array('type' => 'varchar','precision' => '128','comment' => 'website (private)'),
246
-			'contact_freebusy_uri' => array('type' => 'ascii','precision' => '128','comment' => 'freebusy-url for calendar of the contact'),
247
-			'contact_calendar_uri' => array('type' => 'ascii','precision' => '128','comment' => 'url for users calendar - currently not used'),
248
-			'contact_note' => array('type' => 'varchar','precision' => '8192','comment' => 'notes field'),
249
-			'contact_tz' => array('type' => 'varchar','precision' => '8','comment' => 'timezone difference'),
250
-			'contact_geo' => array('type' => 'ascii','precision' => '32','comment' => 'currently not used'),
251
-			'contact_pubkey' => array('type' => 'ascii','precision' => '16384','comment' => 'public key'),
252
-			'contact_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8','comment' => 'timestamp of the creation'),
253
-			'contact_creator' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'account id of the creator'),
254
-			'contact_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'timestamp of the last modified'),
255
-			'contact_modifier' => array('type' => 'int','meta' => 'user','precision' => '4','comment' => 'account id of the last modified'),
256
-			'contact_jpegphoto' => array('type' => 'blob','comment' => 'photo of the contact (attachment)'),
257
-			'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','comment' => 'account id'),
258
-			'contact_etag' => array('type' => 'int','precision' => '4','default' => '0','comment' => 'etag of the changes'),
259
-			'contact_uid' => array('type' => 'ascii','precision' => '128','comment' => 'unique id of the contact'),
260
-			'adr_one_countrycode' => array('type' => 'ascii','precision' => '2','comment' => 'countrycode (business)'),
261
-			'adr_two_countrycode' => array('type' => 'ascii','precision' => '2','comment' => 'countrycode (private)'),
262
-			'carddav_name' => array('type' => 'ascii','precision' => '128','comment' => 'name part of CardDAV URL, if specified by client')
199
+			'contact_id' => array('type' => 'auto', 'nullable' => False),
200
+			'contact_tid' => array('type' => 'char', 'precision' => '1', 'default' => 'n'),
201
+			'contact_owner' => array('type' => 'int', 'meta' => 'account', 'precision' => '8', 'nullable' => False, 'comment' => 'account or group id of the adressbook'),
202
+			'contact_private' => array('type' => 'int', 'precision' => '1', 'default' => '0', 'comment' => 'privat or personal'),
203
+			'cat_id' => array('type' => 'ascii', 'meta' => 'category', 'precision' => '255', 'comment' => 'Category(s)'),
204
+			'n_family' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'Family name'),
205
+			'n_given' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'Given Name'),
206
+			'n_middle' => array('type' => 'varchar', 'precision' => '64'),
207
+			'n_prefix' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'Prefix'),
208
+			'n_suffix' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'Suffix'),
209
+			'n_fn' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'Full name'),
210
+			'n_fileas' => array('type' => 'varchar', 'precision' => '255', 'comment' => 'sort as'),
211
+			'contact_bday' => array('type' => 'varchar', 'precision' => '12', 'comment' => 'Birtday'),
212
+			'org_name' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'Organisation'),
213
+			'org_unit' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'Department'),
214
+			'contact_title' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'jobtittle'),
215
+			'contact_role' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'role'),
216
+			'contact_assistent' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'Name of the Assistent (for phone number)'),
217
+			'contact_room' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'room'),
218
+			'adr_one_street' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'street (business)'),
219
+			'adr_one_street2' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'street (business) - 2. line'),
220
+			'adr_one_locality' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'city (business)'),
221
+			'adr_one_region' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'region (business)'),
222
+			'adr_one_postalcode' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'postalcode (business)'),
223
+			'adr_one_countryname' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'countryname (business)'),
224
+			'contact_label' => array('type' => 'text', 'comment' => 'currently not used'),
225
+			'adr_two_street' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'street (private)'),
226
+			'adr_two_street2' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'street (private) - 2. line'),
227
+			'adr_two_locality' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'city (private)'),
228
+			'adr_two_region' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'region (private)'),
229
+			'adr_two_postalcode' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'postalcode (private)'),
230
+			'adr_two_countryname' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'countryname (private)'),
231
+			'tel_work' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'phone-number (business)'),
232
+			'tel_cell' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'mobil phone (business)'),
233
+			'tel_fax' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'fax-number (business)'),
234
+			'tel_assistent' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'phone-number assistent'),
235
+			'tel_car' => array('type' => 'varchar', 'precision' => '40'),
236
+			'tel_pager' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'pager'),
237
+			'tel_home' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'phone-number (private)'),
238
+			'tel_fax_home' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'fax-number (private)'),
239
+			'tel_cell_private' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'mobil phone (private)'),
240
+			'tel_other' => array('type' => 'varchar', 'precision' => '40', 'comment' => 'other phone'),
241
+			'tel_prefer' => array('type' => 'varchar', 'precision' => '32', 'comment' => 'prefered phone-number'),
242
+			'contact_email' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'email address (business)'),
243
+			'contact_email_home' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'email address (private)'),
244
+			'contact_url' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'website (business)'),
245
+			'contact_url_home' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'website (private)'),
246
+			'contact_freebusy_uri' => array('type' => 'ascii', 'precision' => '128', 'comment' => 'freebusy-url for calendar of the contact'),
247
+			'contact_calendar_uri' => array('type' => 'ascii', 'precision' => '128', 'comment' => 'url for users calendar - currently not used'),
248
+			'contact_note' => array('type' => 'varchar', 'precision' => '8192', 'comment' => 'notes field'),
249
+			'contact_tz' => array('type' => 'varchar', 'precision' => '8', 'comment' => 'timezone difference'),
250
+			'contact_geo' => array('type' => 'ascii', 'precision' => '32', 'comment' => 'currently not used'),
251
+			'contact_pubkey' => array('type' => 'ascii', 'precision' => '16384', 'comment' => 'public key'),
252
+			'contact_created' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'comment' => 'timestamp of the creation'),
253
+			'contact_creator' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'comment' => 'account id of the creator'),
254
+			'contact_modified' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False, 'comment' => 'timestamp of the last modified'),
255
+			'contact_modifier' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'comment' => 'account id of the last modified'),
256
+			'contact_jpegphoto' => array('type' => 'blob', 'comment' => 'photo of the contact (attachment)'),
257
+			'account_id' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'comment' => 'account id'),
258
+			'contact_etag' => array('type' => 'int', 'precision' => '4', 'default' => '0', 'comment' => 'etag of the changes'),
259
+			'contact_uid' => array('type' => 'ascii', 'precision' => '128', 'comment' => 'unique id of the contact'),
260
+			'adr_one_countrycode' => array('type' => 'ascii', 'precision' => '2', 'comment' => 'countrycode (business)'),
261
+			'adr_two_countrycode' => array('type' => 'ascii', 'precision' => '2', 'comment' => 'countrycode (private)'),
262
+			'carddav_name' => array('type' => 'ascii', 'precision' => '128', 'comment' => 'name part of CardDAV URL, if specified by client')
263 263
 		),
264 264
 		'pk' => array('contact_id'),
265 265
 		'fk' => array(),
266
-		'ix' => array('contact_owner','cat_id','n_fileas','contact_modified','contact_uid','carddav_name',array('n_family','n_given'),array('n_given','n_family'),array('org_name','n_family','n_given')),
266
+		'ix' => array('contact_owner', 'cat_id', 'n_fileas', 'contact_modified', 'contact_uid', 'carddav_name', array('n_family', 'n_given'), array('n_given', 'n_family'), array('org_name', 'n_family', 'n_given')),
267 267
 		'uc' => array('account_id')
268 268
 	),
269 269
 	'egw_addressbook_extra' => array(
270 270
 		'fd' => array(
271
-			'contact_id' => array('type' => 'int','precision' => '4','nullable' => False),
272
-			'contact_owner' => array('type' => 'int','meta' => 'account','precision' => '8'),
273
-			'contact_name' => array('type' => 'varchar','meta' => 'cfname','precision' => '64','nullable' => False,'comment' => 'custom-field name'),
274
-			'contact_value' => array('type' => 'varchar','meta' => 'cfvalue','precision' => '16384','comment' => 'custom-field value'),
275
-			'contact_extra_id' => array('type' => 'auto','nullable' => False)
271
+			'contact_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
272
+			'contact_owner' => array('type' => 'int', 'meta' => 'account', 'precision' => '8'),
273
+			'contact_name' => array('type' => 'varchar', 'meta' => 'cfname', 'precision' => '64', 'nullable' => False, 'comment' => 'custom-field name'),
274
+			'contact_value' => array('type' => 'varchar', 'meta' => 'cfvalue', 'precision' => '16384', 'comment' => 'custom-field value'),
275
+			'contact_extra_id' => array('type' => 'auto', 'nullable' => False)
276 276
 		),
277 277
 		'pk' => array('contact_extra_id'),
278 278
 		'fk' => array(),
279
-		'ix' => array('contact_name',array('contact_id','contact_name')),
279
+		'ix' => array('contact_name', array('contact_id', 'contact_name')),
280 280
 		'uc' => array()
281 281
 	),
282 282
 	'egw_addressbook_lists' => array(
283 283
 		'fd' => array(
284
-			'list_id' => array('type' => 'auto','nullable' => False),
285
-			'list_name' => array('type' => 'varchar','precision' => '80','nullable' => False),
286
-			'list_owner' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False),
287
-			'list_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8'),
288
-			'list_creator' => array('type' => 'int','meta' => 'user','precision' => '4'),
289
-			'list_uid' => array('type' => 'ascii','precision' => '128'),
290
-			'list_carddav_name' => array('type' => 'ascii','precision' => '128'),
291
-			'list_etag' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'),
292
-			'list_modified' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'),
293
-			'list_modifier' => array('type' => 'int','meta' => 'user','precision' => '4')
284
+			'list_id' => array('type' => 'auto', 'nullable' => False),
285
+			'list_name' => array('type' => 'varchar', 'precision' => '80', 'nullable' => False),
286
+			'list_owner' => array('type' => 'int', 'meta' => 'account', 'precision' => '4', 'nullable' => False),
287
+			'list_created' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8'),
288
+			'list_creator' => array('type' => 'int', 'meta' => 'user', 'precision' => '4'),
289
+			'list_uid' => array('type' => 'ascii', 'precision' => '128'),
290
+			'list_carddav_name' => array('type' => 'ascii', 'precision' => '128'),
291
+			'list_etag' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '0'),
292
+			'list_modified' => array('type' => 'timestamp', 'nullable' => False, 'default' => 'current_timestamp'),
293
+			'list_modifier' => array('type' => 'int', 'meta' => 'user', 'precision' => '4')
294 294
 		),
295 295
 		'pk' => array('list_id'),
296 296
 		'fk' => array(),
297 297
 		'ix' => array(),
298
-		'uc' => array('list_uid','list_carddav_name',array('list_owner','list_name'))
298
+		'uc' => array('list_uid', 'list_carddav_name', array('list_owner', 'list_name'))
299 299
 	),
300 300
 	'egw_addressbook2list' => array(
301 301
 		'fd' => array(
302
-			'contact_id' => array('type' => 'int','precision' => '4','nullable' => False),
303
-			'list_id' => array('type' => 'int','precision' => '4','nullable' => False),
304
-			'list_added' => array('type' => 'int','meta' => 'timestamp','precision' => '8'),
305
-			'list_added_by' => array('type' => 'int','meta' => 'user','precision' => '4')
302
+			'contact_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
303
+			'list_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
304
+			'list_added' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8'),
305
+			'list_added_by' => array('type' => 'int', 'meta' => 'user', 'precision' => '4')
306 306
 		),
307
-		'pk' => array('contact_id','list_id'),
307
+		'pk' => array('contact_id', 'list_id'),
308 308
 		'fk' => array(),
309 309
 		'ix' => array(),
310 310
 		'uc' => array()
311 311
 	),
312 312
 	'egw_sqlfs' => array(
313 313
 		'fd' => array(
314
-			'fs_id' => array('type' => 'auto','nullable' => False),
315
-			'fs_dir' => array('type' => 'int','precision' => '4','nullable' => False),
316
-			'fs_name' => array('type' => 'varchar','precision' => '200','nullable' => False),
317
-			'fs_mode' => array('type' => 'int','precision' => '2','nullable' => False),
318
-			'fs_uid' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'default' => '0'),
319
-			'fs_gid' => array('type' => 'int','meta' => 'group-abs','precision' => '4','nullable' => False,'default' => '0'),
320
-			'fs_created' => array('type' => 'timestamp','precision' => '8','nullable' => False),
321
-			'fs_modified' => array('type' => 'timestamp','precision' => '8','nullable' => False),
322
-			'fs_mime' => array('type' => 'ascii','precision' => '96','nullable' => False),
323
-			'fs_size' => array('type' => 'int','precision' => '8','nullable' => False),
324
-			'fs_creator' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False),
325
-			'fs_modifier' => array('type' => 'int','meta' => 'user','precision' => '4'),
326
-			'fs_active' => array('type' => 'bool','nullable' => False,'default' => 't'),
314
+			'fs_id' => array('type' => 'auto', 'nullable' => False),
315
+			'fs_dir' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
316
+			'fs_name' => array('type' => 'varchar', 'precision' => '200', 'nullable' => False),
317
+			'fs_mode' => array('type' => 'int', 'precision' => '2', 'nullable' => False),
318
+			'fs_uid' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'default' => '0'),
319
+			'fs_gid' => array('type' => 'int', 'meta' => 'group-abs', 'precision' => '4', 'nullable' => False, 'default' => '0'),
320
+			'fs_created' => array('type' => 'timestamp', 'precision' => '8', 'nullable' => False),
321
+			'fs_modified' => array('type' => 'timestamp', 'precision' => '8', 'nullable' => False),
322
+			'fs_mime' => array('type' => 'ascii', 'precision' => '96', 'nullable' => False),
323
+			'fs_size' => array('type' => 'int', 'precision' => '8', 'nullable' => False),
324
+			'fs_creator' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False),
325
+			'fs_modifier' => array('type' => 'int', 'meta' => 'user', 'precision' => '4'),
326
+			'fs_active' => array('type' => 'bool', 'nullable' => False, 'default' => 't'),
327 327
 			'fs_content' => array('type' => 'blob'),
328
-			'fs_link' => array('type' => 'varchar','precision' => '255')
328
+			'fs_link' => array('type' => 'varchar', 'precision' => '255')
329 329
 		),
330 330
 		'pk' => array('fs_id'),
331 331
 		'fk' => array(),
332
-		'ix' => array(array('fs_dir','fs_active','fs_name(16)')),
332
+		'ix' => array(array('fs_dir', 'fs_active', 'fs_name(16)')),
333 333
 		'uc' => array()
334 334
 	),
335 335
 	'egw_locks' => array(
336 336
 		'fd' => array(
337
-			'lock_token' => array('type' => 'ascii','precision' => '64','nullable' => False),
338
-			'lock_path' => array('type' => 'varchar','precision' => '255','nullable' => False),
339
-			'lock_expires' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False),
340
-			'lock_owner' => array('type' => 'varchar','precision' => '255'),
341
-			'lock_recursive' => array('type' => 'bool','nullable' => False,'default' => '0'),
342
-			'lock_write' => array('type' => 'bool','nullable' => False,'default' => '0'),
343
-			'lock_exclusive' => array('type' => 'bool','nullable' => False,'default' => '0'),
344
-			'lock_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8','default' => '0'),
345
-			'lock_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8','default' => '0'),
346
-			'lock_id' => array('type' => 'auto','nullable' => False)
337
+			'lock_token' => array('type' => 'ascii', 'precision' => '64', 'nullable' => False),
338
+			'lock_path' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False),
339
+			'lock_expires' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'nullable' => False),
340
+			'lock_owner' => array('type' => 'varchar', 'precision' => '255'),
341
+			'lock_recursive' => array('type' => 'bool', 'nullable' => False, 'default' => '0'),
342
+			'lock_write' => array('type' => 'bool', 'nullable' => False, 'default' => '0'),
343
+			'lock_exclusive' => array('type' => 'bool', 'nullable' => False, 'default' => '0'),
344
+			'lock_created' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'default' => '0'),
345
+			'lock_modified' => array('type' => 'int', 'meta' => 'timestamp', 'precision' => '8', 'default' => '0'),
346
+			'lock_id' => array('type' => 'auto', 'nullable' => False)
347 347
 		),
348 348
 		'pk' => array('lock_id'),
349 349
 		'fk' => array(),
350
-		'ix' => array('lock_path','lock_expires'),
350
+		'ix' => array('lock_path', 'lock_expires'),
351 351
 		'uc' => array('lock_token')
352 352
 	),
353 353
 	'egw_sqlfs_props' => array(
354 354
 		'fd' => array(
355
-			'fs_id' => array('type' => 'int','precision' => '4','nullable' => False),
356
-			'prop_namespace' => array('type' => 'ascii','precision' => '64','nullable' => False),
357
-			'prop_name' => array('type' => 'ascii','precision' => '64','nullable' => False),
358
-			'prop_value' => array('type' => 'varchar','precision' => '16384'),
359
-			'prop_id' => array('type' => 'auto','nullable' => False)
355
+			'fs_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
356
+			'prop_namespace' => array('type' => 'ascii', 'precision' => '64', 'nullable' => False),
357
+			'prop_name' => array('type' => 'ascii', 'precision' => '64', 'nullable' => False),
358
+			'prop_value' => array('type' => 'varchar', 'precision' => '16384'),
359
+			'prop_id' => array('type' => 'auto', 'nullable' => False)
360 360
 		),
361 361
 		'pk' => array('prop_id'),
362 362
 		'fk' => array(),
363 363
 		'ix' => array(),
364
-		'uc' => array(array('fs_id','prop_namespace','prop_name'))
364
+		'uc' => array(array('fs_id', 'prop_namespace', 'prop_name'))
365 365
 	),
366 366
 	'egw_customfields' => array(
367 367
 		'fd' => array(
368
-			'cf_id' => array('type' => 'auto','nullable' => False),
369
-			'cf_app' => array('type' => 'ascii','precision' => '16','nullable' => False,'comment' => 'app-name cf belongs too'),
370
-			'cf_name' => array('type' => 'varchar','precision' => '128','nullable' => False,'comment' => 'internal name'),
371
-			'cf_label' => array('type' => 'varchar','precision' => '128','comment' => 'label to display'),
372
-			'cf_type' => array('type' => 'varchar','precision' => '64','nullable' => False,'default' => 'text','comment' => 'type of field'),
373
-			'cf_type2' => array('type' => 'varchar','precision' => '2048','comment' => 'comma-separated subtypes of app, cf is valid for'),
374
-			'cf_help' => array('type' => 'varchar','precision' => '256','comment' => 'helptext'),
375
-			'cf_values' => array('type' => 'varchar','precision' => '8096','comment' => 'json object with value label pairs'),
376
-			'cf_len' => array('type' => 'int','precision' => '2','comment' => 'length or columns of field'),
377
-			'cf_rows' => array('type' => 'int','precision' => '2','comment' => 'rows of field'),
378
-			'cf_order' => array('type' => 'int','precision' => '2','comment' => 'order to display fields'),
379
-			'cf_needed' => array('type' => 'bool','default' => '0','comment' => 'field is required'),
380
-			'cf_private' => array('type' => 'ascii','meta' => 'account-commasep','precision' => '2048','comment' => 'comma-separated account_id'),
381
-			'cf_modifier' => array('type' => 'int','meta' => 'account','precision' => '4','comment' => 'last modifier'),
382
-			'cf_modified' => array('type' => 'timestamp','default' => 'current_timestamp','comment' => 'last modification time'),
383
-			'cf_tab' => array('type' => 'varchar','precision' => '64','comment' => 'tab customfield should be shown')
368
+			'cf_id' => array('type' => 'auto', 'nullable' => False),
369
+			'cf_app' => array('type' => 'ascii', 'precision' => '16', 'nullable' => False, 'comment' => 'app-name cf belongs too'),
370
+			'cf_name' => array('type' => 'varchar', 'precision' => '128', 'nullable' => False, 'comment' => 'internal name'),
371
+			'cf_label' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'label to display'),
372
+			'cf_type' => array('type' => 'varchar', 'precision' => '64', 'nullable' => False, 'default' => 'text', 'comment' => 'type of field'),
373
+			'cf_type2' => array('type' => 'varchar', 'precision' => '2048', 'comment' => 'comma-separated subtypes of app, cf is valid for'),
374
+			'cf_help' => array('type' => 'varchar', 'precision' => '256', 'comment' => 'helptext'),
375
+			'cf_values' => array('type' => 'varchar', 'precision' => '8096', 'comment' => 'json object with value label pairs'),
376
+			'cf_len' => array('type' => 'int', 'precision' => '2', 'comment' => 'length or columns of field'),
377
+			'cf_rows' => array('type' => 'int', 'precision' => '2', 'comment' => 'rows of field'),
378
+			'cf_order' => array('type' => 'int', 'precision' => '2', 'comment' => 'order to display fields'),
379
+			'cf_needed' => array('type' => 'bool', 'default' => '0', 'comment' => 'field is required'),
380
+			'cf_private' => array('type' => 'ascii', 'meta' => 'account-commasep', 'precision' => '2048', 'comment' => 'comma-separated account_id'),
381
+			'cf_modifier' => array('type' => 'int', 'meta' => 'account', 'precision' => '4', 'comment' => 'last modifier'),
382
+			'cf_modified' => array('type' => 'timestamp', 'default' => 'current_timestamp', 'comment' => 'last modification time'),
383
+			'cf_tab' => array('type' => 'varchar', 'precision' => '64', 'comment' => 'tab customfield should be shown')
384 384
 		),
385 385
 		'pk' => array('cf_id'),
386 386
 		'fk' => array(),
387
-		'ix' => array(array('cf_app','cf_order')),
388
-		'uc' => array(array('cf_app','cf_name'))
387
+		'ix' => array(array('cf_app', 'cf_order')),
388
+		'uc' => array(array('cf_app', 'cf_name'))
389 389
 	),
390 390
 	'egw_sharing' => array(
391 391
 		'fd' => array(
392
-			'share_id' => array('type' => 'auto','nullable' => False,'comment' => 'auto-id'),
393
-			'share_token' => array('type' => 'ascii','precision' => '64','nullable' => False,'comment' => 'secure token'),
394
-			'share_path' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'path to share'),
395
-			'share_owner' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'owner of share'),
396
-			'share_expires' => array('type' => 'date','comment' => 'expire date of share'),
397
-			'share_writable' => array('type' => 'int','precision' => '1','nullable' => False,'default' => '0','comment' => '0=readable, 1=writable'),
398
-			'share_with' => array('type' => 'varchar','precision' => '4096','comment' => 'email addresses, comma seperated'),
399
-			'share_passwd' => array('type' => 'varchar','precision' => '128','comment' => 'optional password-hash'),
400
-			'share_created' => array('type' => 'timestamp','nullable' => False,'comment' => 'creation date'),
401
-			'share_last_accessed' => array('type' => 'timestamp','comment' => 'last access of share')
392
+			'share_id' => array('type' => 'auto', 'nullable' => False, 'comment' => 'auto-id'),
393
+			'share_token' => array('type' => 'ascii', 'precision' => '64', 'nullable' => False, 'comment' => 'secure token'),
394
+			'share_path' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'comment' => 'path to share'),
395
+			'share_owner' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'comment' => 'owner of share'),
396
+			'share_expires' => array('type' => 'date', 'comment' => 'expire date of share'),
397
+			'share_writable' => array('type' => 'int', 'precision' => '1', 'nullable' => False, 'default' => '0', 'comment' => '0=readable, 1=writable'),
398
+			'share_with' => array('type' => 'varchar', 'precision' => '4096', 'comment' => 'email addresses, comma seperated'),
399
+			'share_passwd' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'optional password-hash'),
400
+			'share_created' => array('type' => 'timestamp', 'nullable' => False, 'comment' => 'creation date'),
401
+			'share_last_accessed' => array('type' => 'timestamp', 'comment' => 'last access of share')
402 402
 		),
403 403
 		'pk' => array('share_id'),
404 404
 		'fk' => array(),
@@ -407,51 +407,51 @@  discard block
 block discarded – undo
407 407
 	),
408 408
 	'egw_mailaccounts' => array(
409 409
 		'fd' => array(
410
-			'mail_id' => array('type' => 'auto','nullable' => False,'comment' => 'the id'),
411
-			'account_id' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False,'comment' => 'account id of the owner, can be user AND group'),
412
-			'mail_type' => array('type' => 'int','precision' => '1','nullable' => False,'comment' => '0=active, 1=alias, 2=forward, 3=forwardOnly, 4=quota'),
413
-			'mail_value' => array('type' => 'ascii','precision' => '128','nullable' => False,'comment' => 'the value (that should be) corresponding to the mail_type')
410
+			'mail_id' => array('type' => 'auto', 'nullable' => False, 'comment' => 'the id'),
411
+			'account_id' => array('type' => 'int', 'meta' => 'account', 'precision' => '4', 'nullable' => False, 'comment' => 'account id of the owner, can be user AND group'),
412
+			'mail_type' => array('type' => 'int', 'precision' => '1', 'nullable' => False, 'comment' => '0=active, 1=alias, 2=forward, 3=forwardOnly, 4=quota'),
413
+			'mail_value' => array('type' => 'ascii', 'precision' => '128', 'nullable' => False, 'comment' => 'the value (that should be) corresponding to the mail_type')
414 414
 		),
415 415
 		'pk' => array('mail_id'),
416 416
 		'fk' => array(),
417
-		'ix' => array('mail_value',array('account_id','mail_type')),
417
+		'ix' => array('mail_value', array('account_id', 'mail_type')),
418 418
 		'uc' => array()
419 419
 	),
420 420
 	'egw_ea_accounts' => array(
421 421
 		'fd' => array(
422
-			'acc_id' => array('type' => 'auto','nullable' => False),
423
-			'acc_name' => array('type' => 'varchar','precision' => '80','comment' => 'description'),
424
-			'ident_id' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'standard identity'),
425
-			'acc_imap_host' => array('type' => 'ascii','precision' => '128','nullable' => False,'comment' => 'imap hostname'),
426
-			'acc_imap_ssl' => array('type' => 'int','precision' => '1','nullable' => False,'default' => '0','comment' => '0=none, 1=starttls, 2=tls, 3=ssl, &8=validate certificate'),
427
-			'acc_imap_port' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '143','comment' => 'imap port'),
428
-			'acc_sieve_enabled' => array('type' => 'bool','default' => '0','comment' => 'sieve enabled'),
429
-			'acc_sieve_host' => array('type' => 'ascii','precision' => '128','comment' => 'sieve host, default imap_host'),
430
-			'acc_sieve_port' => array('type' => 'int','precision' => '4','default' => '4190'),
431
-			'acc_folder_sent' => array('type' => 'varchar','precision' => '128','comment' => 'sent folder'),
432
-			'acc_folder_trash' => array('type' => 'varchar','precision' => '128','comment' => 'trash folder'),
433
-			'acc_folder_draft' => array('type' => 'varchar','precision' => '128','comment' => 'draft folder'),
434
-			'acc_folder_template' => array('type' => 'varchar','precision' => '128','comment' => 'template folder'),
435
-			'acc_folder_archive' => array('type' => 'varchar','precision' => '128','comment' => 'archive folder'),
436
-			'acc_smtp_host' => array('type' => 'varchar','precision' => '128','comment' => 'smtp hostname'),
437
-			'acc_smtp_ssl' => array('type' => 'int','precision' => '1','nullable' => False,'default' => '0','comment' => '0=none, 1=starttls, 2=tls, 3=ssl, &8=validate certificate'),
438
-			'acc_smtp_port' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '25','comment' => 'smtp port'),
439
-			'acc_smtp_type' => array('type' => 'ascii','precision' => '32','default' => 'emailadmin_smtp','comment' => 'smtp class to use'),
440
-			'acc_imap_type' => array('type' => 'ascii','precision' => '32','default' => 'emailadmin_imap','comment' => 'imap class to use'),
441
-			'acc_imap_logintype' => array('type' => 'ascii','precision' => '20','comment' => 'standard, vmailmgr, admin, uidNumber'),
442
-			'acc_domain' => array('type' => 'varchar','precision' => '100','comment' => 'domain name'),
443
-			'acc_user_editable' => array('type' => 'bool','nullable' => False,'default' => '1','comment' => '0=no, 1=yes'),
444
-			'acc_sieve_ssl' => array('type' => 'int','precision' => '1','default' => '1','comment' => '0=none, 1=starttls, 2=tls, 3=ssl, &8=validate certificate'),
445
-			'acc_modified' => array('type' => 'timestamp','nullable' => False,'default' => 'current_timestamp'),
446
-			'acc_modifier' => array('type' => 'int','meta' => 'user','precision' => '4'),
447
-			'acc_smtp_auth_session' => array('type' => 'bool','comment' => '0=no, 1=yes, use username/pw from current user'),
448
-			'acc_folder_junk' => array('type' => 'varchar','precision' => '128','comment' => 'junk folder'),
449
-			'acc_imap_default_quota' => array('type' => 'int','precision' => '4','comment' => 'default quota, if no user specific one set'),
450
-			'acc_imap_timeout' => array('type' => 'int','precision' => '2','comment' => 'timeout for imap connection'),
451
-			'acc_user_forward' => array('type' => 'bool','default' => '0','comment' => 'allow user to define forwards'),
452
-			'acc_further_identities' => array('type' => 'int','precision' => '1','nullable' => False,'default' => '1','comment' => '0=no, 1=yes, 2=only matching aliases'),
453
-			'acc_folder_ham' => array('type' => 'varchar','precision' => '128','comment' => 'ham folder'),
454
-			'acc_spam_api' => array('type' => 'varchar','precision' => '128','comment' => 'SpamTitan API URL')
422
+			'acc_id' => array('type' => 'auto', 'nullable' => False),
423
+			'acc_name' => array('type' => 'varchar', 'precision' => '80', 'comment' => 'description'),
424
+			'ident_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'standard identity'),
425
+			'acc_imap_host' => array('type' => 'ascii', 'precision' => '128', 'nullable' => False, 'comment' => 'imap hostname'),
426
+			'acc_imap_ssl' => array('type' => 'int', 'precision' => '1', 'nullable' => False, 'default' => '0', 'comment' => '0=none, 1=starttls, 2=tls, 3=ssl, &8=validate certificate'),
427
+			'acc_imap_port' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '143', 'comment' => 'imap port'),
428
+			'acc_sieve_enabled' => array('type' => 'bool', 'default' => '0', 'comment' => 'sieve enabled'),
429
+			'acc_sieve_host' => array('type' => 'ascii', 'precision' => '128', 'comment' => 'sieve host, default imap_host'),
430
+			'acc_sieve_port' => array('type' => 'int', 'precision' => '4', 'default' => '4190'),
431
+			'acc_folder_sent' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'sent folder'),
432
+			'acc_folder_trash' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'trash folder'),
433
+			'acc_folder_draft' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'draft folder'),
434
+			'acc_folder_template' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'template folder'),
435
+			'acc_folder_archive' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'archive folder'),
436
+			'acc_smtp_host' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'smtp hostname'),
437
+			'acc_smtp_ssl' => array('type' => 'int', 'precision' => '1', 'nullable' => False, 'default' => '0', 'comment' => '0=none, 1=starttls, 2=tls, 3=ssl, &8=validate certificate'),
438
+			'acc_smtp_port' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'default' => '25', 'comment' => 'smtp port'),
439
+			'acc_smtp_type' => array('type' => 'ascii', 'precision' => '32', 'default' => 'emailadmin_smtp', 'comment' => 'smtp class to use'),
440
+			'acc_imap_type' => array('type' => 'ascii', 'precision' => '32', 'default' => 'emailadmin_imap', 'comment' => 'imap class to use'),
441
+			'acc_imap_logintype' => array('type' => 'ascii', 'precision' => '20', 'comment' => 'standard, vmailmgr, admin, uidNumber'),
442
+			'acc_domain' => array('type' => 'varchar', 'precision' => '100', 'comment' => 'domain name'),
443
+			'acc_user_editable' => array('type' => 'bool', 'nullable' => False, 'default' => '1', 'comment' => '0=no, 1=yes'),
444
+			'acc_sieve_ssl' => array('type' => 'int', 'precision' => '1', 'default' => '1', 'comment' => '0=none, 1=starttls, 2=tls, 3=ssl, &8=validate certificate'),
445
+			'acc_modified' => array('type' => 'timestamp', 'nullable' => False, 'default' => 'current_timestamp'),
446
+			'acc_modifier' => array('type' => 'int', 'meta' => 'user', 'precision' => '4'),
447
+			'acc_smtp_auth_session' => array('type' => 'bool', 'comment' => '0=no, 1=yes, use username/pw from current user'),
448
+			'acc_folder_junk' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'junk folder'),
449
+			'acc_imap_default_quota' => array('type' => 'int', 'precision' => '4', 'comment' => 'default quota, if no user specific one set'),
450
+			'acc_imap_timeout' => array('type' => 'int', 'precision' => '2', 'comment' => 'timeout for imap connection'),
451
+			'acc_user_forward' => array('type' => 'bool', 'default' => '0', 'comment' => 'allow user to define forwards'),
452
+			'acc_further_identities' => array('type' => 'int', 'precision' => '1', 'nullable' => False, 'default' => '1', 'comment' => '0=no, 1=yes, 2=only matching aliases'),
453
+			'acc_folder_ham' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'ham folder'),
454
+			'acc_spam_api' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'SpamTitan API URL')
455 455
 		),
456 456
 		'pk' => array('acc_id'),
457 457
 		'fk' => array(),
@@ -460,29 +460,29 @@  discard block
 block discarded – undo
460 460
 	),
461 461
 	'egw_ea_credentials' => array(
462 462
 		'fd' => array(
463
-			'cred_id' => array('type' => 'auto','nullable' => False),
464
-			'acc_id' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'into egw_ea_accounts'),
465
-			'cred_type' => array('type' => 'int','precision' => '1','nullable' => False,'comment' => '&1=imap, &2=smtp, &4=admin'),
466
-			'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'account_id or 0=all'),
467
-			'cred_username' => array('type' => 'varchar','precision' => '80','nullable' => False,'comment' => 'username'),
468
-			'cred_password' => array('type' => 'varchar','precision' => '80','comment' => 'password encrypted'),
469
-			'cred_pw_enc' => array('type' => 'int','precision' => '1','default' => '0','comment' => '0=not, 1=user pw, 2=system')
463
+			'cred_id' => array('type' => 'auto', 'nullable' => False),
464
+			'acc_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'into egw_ea_accounts'),
465
+			'cred_type' => array('type' => 'int', 'precision' => '1', 'nullable' => False, 'comment' => '&1=imap, &2=smtp, &4=admin'),
466
+			'account_id' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'comment' => 'account_id or 0=all'),
467
+			'cred_username' => array('type' => 'varchar', 'precision' => '80', 'nullable' => False, 'comment' => 'username'),
468
+			'cred_password' => array('type' => 'varchar', 'precision' => '80', 'comment' => 'password encrypted'),
469
+			'cred_pw_enc' => array('type' => 'int', 'precision' => '1', 'default' => '0', 'comment' => '0=not, 1=user pw, 2=system')
470 470
 		),
471 471
 		'pk' => array('cred_id'),
472 472
 		'fk' => array(),
473 473
 		'ix' => array(),
474
-		'uc' => array(array('acc_id','account_id','cred_type'))
474
+		'uc' => array(array('acc_id', 'account_id', 'cred_type'))
475 475
 	),
476 476
 	'egw_ea_identities' => array(
477 477
 		'fd' => array(
478
-			'ident_id' => array('type' => 'auto','nullable' => False),
479
-			'acc_id' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'for which account'),
480
-			'ident_realname' => array('type' => 'varchar','precision' => '128','nullable' => False,'comment' => 'real name'),
481
-			'ident_email' => array('type' => 'varchar','precision' => '128','comment' => 'email address'),
482
-			'ident_org' => array('type' => 'varchar','precision' => '128','comment' => 'organisation'),
483
-			'ident_signature' => array('type' => 'text','comment' => 'signature text'),
484
-			'account_id' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False,'default' => '0','comment' => '0=all users of give mail account'),
485
-			'ident_name' => array('type' => 'varchar','precision' => '128','comment' => 'name of identity to display')
478
+			'ident_id' => array('type' => 'auto', 'nullable' => False),
479
+			'acc_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'for which account'),
480
+			'ident_realname' => array('type' => 'varchar', 'precision' => '128', 'nullable' => False, 'comment' => 'real name'),
481
+			'ident_email' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'email address'),
482
+			'ident_org' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'organisation'),
483
+			'ident_signature' => array('type' => 'text', 'comment' => 'signature text'),
484
+			'account_id' => array('type' => 'int', 'meta' => 'account', 'precision' => '4', 'nullable' => False, 'default' => '0', 'comment' => '0=all users of give mail account'),
485
+			'ident_name' => array('type' => 'varchar', 'precision' => '128', 'comment' => 'name of identity to display')
486 486
 		),
487 487
 		'pk' => array('ident_id'),
488 488
 		'fk' => array(),
@@ -491,24 +491,24 @@  discard block
 block discarded – undo
491 491
 	),
492 492
 	'egw_ea_valid' => array(
493 493
 		'fd' => array(
494
-			'acc_id' => array('type' => 'int','precision' => '4','nullable' => False),
495
-			'account_id' => array('type' => 'int','meta' => 'account','precision' => '4','nullable' => False)
494
+			'acc_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False),
495
+			'account_id' => array('type' => 'int', 'meta' => 'account', 'precision' => '4', 'nullable' => False)
496 496
 		),
497 497
 		'pk' => array(),
498 498
 		'fk' => array(),
499
-		'ix' => array(array('account_id','acc_id')),
500
-		'uc' => array(array('acc_id','account_id'))
499
+		'ix' => array(array('account_id', 'acc_id')),
500
+		'uc' => array(array('acc_id', 'account_id'))
501 501
 	),
502 502
 	'egw_ea_notifications' => array(
503 503
 		'fd' => array(
504
-			'notif_id' => array('type' => 'auto','nullable' => False),
505
-			'acc_id' => array('type' => 'int','precision' => '4','nullable' => False,'comment' => 'mail account'),
506
-			'account_id' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'user account'),
507
-			'notif_folder' => array('type' => 'varchar','precision' => '255','nullable' => False,'comment' => 'folder name')
504
+			'notif_id' => array('type' => 'auto', 'nullable' => False),
505
+			'acc_id' => array('type' => 'int', 'precision' => '4', 'nullable' => False, 'comment' => 'mail account'),
506
+			'account_id' => array('type' => 'int', 'meta' => 'user', 'precision' => '4', 'nullable' => False, 'comment' => 'user account'),
507
+			'notif_folder' => array('type' => 'varchar', 'precision' => '255', 'nullable' => False, 'comment' => 'folder name')
508 508
 		),
509 509
 		'pk' => array('notif_id'),
510 510
 		'fk' => array(),
511
-		'ix' => array(array('account_id','acc_id')),
511
+		'ix' => array(array('account_id', 'acc_id')),
512 512
 		'uc' => array()
513 513
 	)
514 514
 );
Please login to merge, or discard this patch.
admin/inc/class.admin_mail.inc.php 1 patch
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @var array
90 90
 	 */
91 91
 	public static $ssl_types = array(
92
-		self::SSL_TLS => 'TLS',	// SSL with minimum TLS (no SSL v.2 or v.3), requires Horde_Imap_Client-2.16.0/Horde_Socket_Client-1.1.0
92
+		self::SSL_TLS => 'TLS', // SSL with minimum TLS (no SSL v.2 or v.3), requires Horde_Imap_Client-2.16.0/Horde_Socket_Client-1.1.0
93 93
 		self::SSL_SSL => 'SSL',
94 94
 		self::SSL_STARTTLS => 'STARTTLS',
95 95
 		'no' => 'no',
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	public static $ssl2secure = array(
103 103
 		'SSL' => 'ssl',
104 104
 		'STARTTLS' => 'tls',
105
-		'TLS' => 'tlsv1',	// SSL with minimum TLS (no SSL v.2 or v.3), requires Horde_Imap_Client-2.16.0/Horde_Socket_Client-1.1.0
105
+		'TLS' => 'tlsv1', // SSL with minimum TLS (no SSL v.2 or v.3), requires Horde_Imap_Client-2.16.0/Horde_Socket_Client-1.1.0
106 106
 	);
107 107
 	/**
108 108
 	 * Convert ssl-type to eMailAdmin acc_(imap|sieve|smtp)_ssl integer value
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	 * @param array $content
180 180
 	 * @param type $msg
181 181
 	 */
182
-	public function add(array $content=array(), $msg='', $msg_type='success')
182
+	public function add(array $content = array(), $msg = '', $msg_type = 'success')
183 183
 	{
184 184
 		// otherwise we cant switch to ckeditor in edit
185 185
 		Api\Html\CkEditorConfig::set_csp_script_src_attrs();
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 		if ($content['button'] && key($content['button']) == 'skip_imap')
220 220
 		{
221 221
 			unset($content['button']);
222
-			if (!isset($content['acc_smtp_host'])) $content['acc_smtp_host'] = '';	// do manual mode right away
222
+			if (!isset($content['acc_smtp_host'])) $content['acc_smtp_host'] = ''; // do manual mode right away
223 223
 			return $this->smtp($content, lang('Skipping IMAP configuration!'));
224 224
 		}
225 225
 		$content['output'] = '';
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		if (!empty($content['acc_imap_host']))
234 234
 		{
235 235
 			$hosts = array($content['acc_imap_host'] => true);
236
-			if ($content['acc_imap_port'] > 0 && !in_array($content['acc_imap_port'], array(143,993)))
236
+			if ($content['acc_imap_port'] > 0 && !in_array($content['acc_imap_port'], array(143, 993)))
237 237
 			{
238 238
 				$ssl_type = (string)array_search($content['acc_imap_ssl'], self::$ssl2type);
239 239
 				if ($ssl_type === '') $ssl_type = 'insecure';
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 			$content['ispdb'] = $ispdb;
248 248
 			$content['output'] .= lang('Using data from Mozilla ISPDB for provider %1', $ispdb['displayName'])."\n";
249 249
 			$hosts = array();
250
-			foreach($ispdb['imap'] as $server)
250
+			foreach ($ispdb['imap'] as $server)
251 251
 			{
252 252
 				if (!isset($hosts[$server['hostname']]))
253 253
 				{
@@ -271,13 +271,13 @@  discard block
 block discarded – undo
271 271
 		}
272 272
 
273 273
 		// iterate over all hosts and try to connect
274
-		foreach($hosts as $host => $data)
274
+		foreach ($hosts as $host => $data)
275 275
 		{
276 276
 			$content['acc_imap_host'] = $host;
277 277
 			// by default we check SSL, STARTTLS and at last an insecure connection
278 278
 			if (!is_array($data)) $data = array('TLS' => 993, 'SSL' => 993, 'STARTTLS' => 143, 'insecure' => 143);
279 279
 
280
-			foreach($data as $ssl => $port)
280
+			foreach ($data as $ssl => $port)
281 281
 			{
282 282
 				if ($ssl === 'username') continue;
283 283
 
@@ -302,17 +302,17 @@  discard block
 block discarded – undo
302 302
 					$content['connected'] = $connected = true;
303 303
 					break 2;
304 304
 				}
305
-				catch(Horde_Imap_Client_Exception $e)
305
+				catch (Horde_Imap_Client_Exception $e)
306 306
 				{
307
-					switch($e->getCode())
307
+					switch ($e->getCode())
308 308
 					{
309 309
 						case Horde_Imap_Client_Exception::LOGIN_AUTHENTICATIONFAILED:
310 310
 							$content['output'] .= "\n".$e->getMessage()."\n";
311
-							break 3;	// no need to try other SSL or non-SSL connections, if auth failed
311
+							break 3; // no need to try other SSL or non-SSL connections, if auth failed
312 312
 
313 313
 						case Horde_Imap_Client_Exception::SERVER_CONNECT:
314 314
 							$content['output'] .= "\n".$e->getMessage()."\n";
315
-							if ($ssl == 'STARTTLS') break 2;	// no need to try insecure connection on same port
315
+							if ($ssl == 'STARTTLS') break 2; // no need to try insecure connection on same port
316 316
 							break;
317 317
 
318 318
 						default:
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 					}
322 322
 					if (self::$debug) _egw_log_exception($e);
323 323
 				}
324
-				catch(Exception $e) {
324
+				catch (Exception $e) {
325 325
 					$content['output'] .= "\n".get_class($e).': '.$e->getMessage().' ('.$e->getCode().')'."\n";
326 326
 					//$content['output'] .= $e->getTraceAsString()."\n";
327 327
 					if (self::$debug) _egw_log_exception($e);
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		// add validation error, if we can identify a field
338 338
 		if (!$connected && $e instanceof Horde_Imap_Client_Exception)
339 339
 		{
340
-			switch($e->getCode())
340
+			switch ($e->getCode())
341 341
 			{
342 342
 				case Horde_Imap_Client_Exception::LOGIN_AUTHENTICATIONFAILED:
343 343
 					Etemplate::set_validation_error('acc_imap_username', lang($e->getMessage()));
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
 	 * @param string $msg =''
364 364
 	 * @param Horde_Imap_Client_Socket $imap =null
365 365
 	 */
366
-	public function folder(array $content, $msg='', Horde_Imap_Client_Socket $imap=null)
366
+	public function folder(array $content, $msg = '', Horde_Imap_Client_Socket $imap = null)
367 367
 	{
368 368
 		if (isset($content['button']))
369 369
 		{
370 370
 			list($button) = each($content['button']);
371 371
 			unset($content['button']);
372
-			switch($button)
372
+			switch ($button)
373 373
 			{
374 374
 				case 'back':
375 375
 					return $this->add($content);
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 			}
380 380
 		}
381 381
 		$content['msg'] = $msg;
382
-		if (!isset($imap)) $imap = self::imap_client ($content);
382
+		if (!isset($imap)) $imap = self::imap_client($content);
383 383
 
384 384
 		try {
385 385
 			//_debug_array($content);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 					$sel_options['acc_folder_junk'] = $sel_options['acc_folder_archive'] =
389 389
 						$sel_options['acc_folder_ham'] = self::mailboxes($imap, $content);
390 390
 		}
391
-		catch(Exception $e) {
391
+		catch (Exception $e) {
392 392
 			$content['msg'] = $e->getMessage();
393 393
 			if (self::$debug) _egw_log_exception($e);
394 394
 		}
@@ -405,27 +405,27 @@  discard block
 block discarded – undo
405 405
 	 * @return array with folders as key AND value
406 406
 	 * @throws Horde_Imap_Client_Exception
407 407
 	 */
408
-	public static function mailboxes(Horde_Imap_Client_Socket $imap, array &$content=null)
408
+	public static function mailboxes(Horde_Imap_Client_Socket $imap, array &$content = null)
409 409
 	{
410 410
 		// query all subscribed mailboxes
411 411
 		$mailboxes = $imap->listMailboxes('*', Horde_Imap_Client::MBOX_SUBSCRIBED, array(
412 412
 			'special_use' => true,
413
-			'attributes' => true,	// otherwise special_use is only queried, but not returned ;-)
413
+			'attributes' => true, // otherwise special_use is only queried, but not returned ;-)
414 414
 			'delimiter' => true,
415 415
 		));
416 416
 		//_debug_array($mailboxes);
417 417
 		// list mailboxes by special-use attributes
418 418
 		$folders = $attributes = $all = array();
419
-		foreach($mailboxes as $mailbox => $data)
419
+		foreach ($mailboxes as $mailbox => $data)
420 420
 		{
421
-			foreach($data['attributes'] as $attribute)
421
+			foreach ($data['attributes'] as $attribute)
422 422
 			{
423 423
 				$attributes[$attribute][] = $mailbox;
424 424
 			}
425 425
 			$folders[$mailbox] = $mailbox.': '.implode(', ', $data['attributes']);
426 426
 		}
427 427
 		// pre-select send, trash, ... folder for user, by checking special-use attributes or common name(s)
428
-		foreach(array(
428
+		foreach (array(
429 429
 			'acc_folder_sent'  => array('\\sent', 'sent'),
430 430
 			'acc_folder_trash' => array('\\trash', 'trash'),
431 431
 			'acc_folder_draft' => array('\\drafts', 'drafts'),
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 			// first check special-use attributes
439 439
 			if (($special_use = array_shift($common_names)))
440 440
 			{
441
-				foreach((array)$attributes[$special_use] as $mailbox)
441
+				foreach ((array)$attributes[$special_use] as $mailbox)
442 442
 				{
443 443
 					if (empty($content[$name]) || strlen($mailbox) < strlen($content[$name]))
444 444
 					{
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 			// no special use folder found, try common names
450 450
 			if (empty($content[$name]))
451 451
 			{
452
-				foreach($mailboxes as $mailbox => $data)
452
+				foreach ($mailboxes as $mailbox => $data)
453 453
 				{
454 454
 					$delimiter = !empty($data['delimiter']) ? $data['delimiter'] : '.';
455 455
 					$name_parts = explode($delimiter, strtolower($mailbox));
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 	 * @param array $content
477 477
 	 * @param string $msg =''
478 478
 	 */
479
-	public function sieve(array $content, $msg='')
479
+	public function sieve(array $content, $msg = '')
480 480
 	{
481 481
 		static $sieve_ssl2port = array(
482 482
 			self::SSL_TLS => 5190,
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		{
491 491
 			list($button) = each($content['button']);
492 492
 			unset($content['button']);
493
-			switch($button)
493
+			switch ($button)
494 494
 			{
495 495
 				case 'back':
496 496
 					return $this->folder($content);
@@ -539,9 +539,9 @@  discard block
 block discarded – undo
539 539
 			{
540 540
 				$data = $sieve_ssl2port;
541 541
 			}
542
-			foreach($data as $ssl => $ports)
542
+			foreach ($data as $ssl => $ports)
543 543
 			{
544
-				foreach((array)$ports as $port)
544
+				foreach ((array)$ports as $port)
545 545
 				{
546 546
 					$content['acc_sieve_ssl'] = $ssl;
547 547
 					$ssl_label = self::$ssl_types[$ssl];
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 						));
560 560
 						// connect to sieve server
561 561
 						$sieve->connect();
562
-						$content['sieve_output'] .= "\n".lang('Successful connected to %1 server%2.', 'Sieve','');
562
+						$content['sieve_output'] .= "\n".lang('Successful connected to %1 server%2.', 'Sieve', '');
563 563
 						// and log in
564 564
 						$sieve->login($content['acc_imap_username'], $content['acc_imap_password']);
565 565
 						$content['sieve_output'] .= ' '.lang('and logged in')."\n";
@@ -569,10 +569,10 @@  discard block
 block discarded – undo
569 569
 						return $this->smtp($content, lang('Successful connected to %1 server%2.', 'Sieve',
570 570
 							' '.lang('and logged in')));
571 571
 					}
572
-					catch(Horde\ManageSieve\Exception\ConnectionFailed $e) {
572
+					catch (Horde\ManageSieve\Exception\ConnectionFailed $e) {
573 573
 						$content['sieve_output'] .= "\n".$e->getMessage().' '.$e->details."\n";
574 574
 					}
575
-					catch(Exception $e) {
575
+					catch (Exception $e) {
576 576
 						$content['sieve_output'] .= "\n".get_class($e).': '.$e->getMessage().
577 577
 							($e->details ? ' '.$e->details : '').' ('.$e->getCode().')'."\n";
578 578
 						$content['sieve_output'] .= $e->getTraceAsString()."\n";
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 		// add validation error, if we can identify a field
591 591
 		if (!$content['sieve_connected'] && $e instanceof Exception)
592 592
 		{
593
-			switch($e->getCode())
593
+			switch ($e->getCode())
594 594
 			{
595 595
 				case 61:	// connection refused
596 596
 				case 60:	// connection timed out (imap.googlemail.com returns that for none-ssl/4190/2000)
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 	 * @param array $content
614 614
 	 * @param string $msg =''
615 615
 	 */
616
-	public function smtp(array $content, $msg='')
616
+	public function smtp(array $content, $msg = '')
617 617
 	{
618 618
 		static $smtp_ssl2port = array(
619 619
 			self::SSL_NONE => 25,
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 		{
628 628
 			list($button) = each($content['button']);
629 629
 			unset($content['button']);
630
-			switch($button)
630
+			switch ($button)
631 631
 			{
632 632
 				case 'back':
633 633
 					return $this->sieve($content);
@@ -668,11 +668,11 @@  discard block
 block discarded – undo
668 668
 					);
669 669
 				}
670 670
 			}
671
-			elseif($content['ispdb'] && !empty($content['ispdb']['smtp']))
671
+			elseif ($content['ispdb'] && !empty($content['ispdb']['smtp']))
672 672
 			{
673 673
 				$content['smtp_output'] .= lang('Using data from Mozilla ISPDB for provider %1', $content['ispdb']['displayName'])."\n";
674 674
 				$hosts = array();
675
-				foreach($content['ispdb']['smtp'] as $server)
675
+				foreach ($content['ispdb']['smtp'] as $server)
676 676
 				{
677 677
 					if (!isset($hosts[$server['hostname']]))
678 678
 					{
@@ -694,14 +694,14 @@  discard block
 block discarded – undo
694 694
 			{
695 695
 				$hosts = $this->guess_hosts($content['ident_email'], 'smtp');
696 696
 			}
697
-			foreach($hosts as $host => $data)
697
+			foreach ($hosts as $host => $data)
698 698
 			{
699 699
 				$content['acc_smtp_host'] = $host;
700 700
 				if (!is_array($data))
701 701
 				{
702 702
 					$data = array('TLS' => 465, 'SSL' => 465, 'STARTTLS' => 587, '' => 25);
703 703
 				}
704
-				foreach($data as $ssl => $port)
704
+				foreach ($data as $ssl => $port)
705 705
 				{
706 706
 					if ($ssl === 'username') continue;
707 707
 
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
 						$content['smtp_output'] .= "\n".Api\DateTime::to('now', 'H:i:s').": Trying $ssl connection to $host:$port ...\n";
713 713
 						$content['acc_smtp_port'] = $port;
714 714
 
715
-						$mail = new Horde_Mail_Transport_Smtphorde($params=array(
715
+						$mail = new Horde_Mail_Transport_Smtphorde($params = array(
716 716
 							'username' => $content['acc_smtp_username'],
717 717
 							'password' => $content['acc_smtp_password'],
718 718
 							'host' => $content['acc_smtp_host'],
@@ -752,9 +752,9 @@  discard block
 block discarded – undo
752 752
 					}
753 753
 					// unfortunately LOGIN_AUTHENTICATIONFAILED and SERVER_CONNECT are thrown as Horde_Mail_Exception
754 754
 					// while others are thrown as Horde_Smtp_Exception --> using common base Horde_Exception_Wrapped
755
-					catch(Horde_Exception_Wrapped $e)
755
+					catch (Horde_Exception_Wrapped $e)
756 756
 					{
757
-						switch($e->getCode())
757
+						switch ($e->getCode())
758 758
 						{
759 759
 							case Horde_Smtp_Exception::LOGIN_AUTHENTICATIONFAILED:
760 760
 							case Horde_Smtp_Exception::LOGIN_REQUIREAUTHENTICATION:
@@ -770,14 +770,14 @@  discard block
 block discarded – undo
770 770
 						}
771 771
 						if (self::$debug) _egw_log_exception($e);
772 772
 					}
773
-					catch(Horde_Smtp_Exception $e)
773
+					catch (Horde_Smtp_Exception $e)
774 774
 					{
775 775
 						// prever $e->details over $e->getMessage() as it contains original message from SMTP server (eg. relay access denied)
776 776
 						$content['smtp_output'] .= "\n".(empty($e->details) ? $e->getMessage().' ('.$e->getCode().')' : $e->details)."\n";
777 777
 						//$content['smtp_output'] .= $e->getTraceAsString()."\n";
778 778
 						if (self::$debug) _egw_log_exception($e);
779 779
 					}
780
-					catch(Exception $e) {
780
+					catch (Exception $e) {
781 781
 						$content['smtp_output'] .= "\n".get_class($e).': '.$e->getMessage().' ('.$e->getCode().')'."\n";
782 782
 						//$content['smtp_output'] .= $e->getTraceAsString()."\n";
783 783
 						if (self::$debug) _egw_log_exception($e);
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 		// add validation error, if we can identify a field
789 789
 		if (!$content['smtp_connected'] && $e instanceof Horde_Exception_Wrapped)
790 790
 		{
791
-			switch($e->getCode())
791
+			switch ($e->getCode())
792 792
 			{
793 793
 				case Horde_Smtp_Exception::LOGIN_AUTHENTICATIONFAILED:
794 794
 				case Horde_Smtp_Exception::LOGIN_REQUIREAUTHENTICATION:
@@ -822,14 +822,14 @@  discard block
 block discarded – undo
822 822
 	 * @param string $msg =''
823 823
 	 * @param string $msg_type ='success'
824 824
 	 */
825
-	public function edit(array $content=null, $msg='', $msg_type='success')
825
+	public function edit(array $content = null, $msg = '', $msg_type = 'success')
826 826
 	{
827 827
 		// app is trying to tell something, while redirecting to wizard
828
-		if (empty($content) && $_GET['acc_id'] && empty($msg) && !empty( $_GET['msg']))
828
+		if (empty($content) && $_GET['acc_id'] && empty($msg) && !empty($_GET['msg']))
829 829
 		{
830
-			if (stripos($_GET['msg'],'fatal error:')!==false || $_GET['msg_type'] == 'error') $msg_type = 'error';
830
+			if (stripos($_GET['msg'], 'fatal error:') !== false || $_GET['msg_type'] == 'error') $msg_type = 'error';
831 831
 		}
832
-		if ($content['acc_id'] || (isset($_GET['acc_id']) && (int)$_GET['acc_id'] > 0) ) Mail::unsetCachedObjects($content['acc_id']?$content['acc_id']:$_GET['acc_id']);
832
+		if ($content['acc_id'] || (isset($_GET['acc_id']) && (int)$_GET['acc_id'] > 0)) Mail::unsetCachedObjects($content['acc_id'] ? $content['acc_id'] : $_GET['acc_id']);
833 833
 		$tpl = new Etemplate('admin.mailaccount');
834 834
 
835 835
 		if (!is_array($content) || !empty($content['acc_id']) && isset($content['old_acc_id']) && $content['acc_id'] != $content['old_acc_id'])
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
 					list($content['acc_id']) = each($content['accounts']);
845 845
 					//error_log(__METHOD__.__LINE__.'.'.array2string($content['acc_id']));
846 846
 					// test if the "to be selected" acccount is imap or not
847
-					if (count($content['accounts'])>1 && Mail\Account::is_multiple($content['acc_id']))
847
+					if (count($content['accounts']) > 1 && Mail\Account::is_multiple($content['acc_id']))
848 848
 					{
849 849
 						try {
850 850
 							$account = Mail\Account::read($content['acc_id'], $content['called_for']);
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
 								//error_log(__METHOD__.__LINE__.'.'.array2string($content['acc_id']));
856 856
 							}
857 857
 						}
858
-						catch(Api\Exception\NotFound $e) {
858
+						catch (Api\Exception\NotFound $e) {
859 859
 							if (self::$debug) _egw_log_exception($e);
860 860
 						}
861 861
 					}
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 				try {
879 879
 					$account = Mail\Account::read($content['acc_id'], $this->is_admin && $content['called_for'] ?
880 880
 						$content['called_for'] : $GLOBALS['egw_info']['user']['account_id']);
881
-					$account->getUserData();	// quota, aliases, forwards etc.
881
+					$account->getUserData(); // quota, aliases, forwards etc.
882 882
 					$content += $account->params;
883 883
 					$content['acc_sieve_enabled'] = (string)($content['acc_sieve_enabled']);
884 884
 					$content['notify_use_default'] = !$content['notify_account_id'];
@@ -889,16 +889,16 @@  discard block
 block discarded – undo
889 889
 					$content['std_ident_id'] = $content['ident_id'];
890 890
 					$content['identities'][$content['std_ident_id']] = lang('Standard identity');
891 891
 					// change self::SSL_NONE (=0) to "no" used in sel_options
892
-					foreach(array('imap','smtp','sieve') as $type)
892
+					foreach (array('imap', 'smtp', 'sieve') as $type)
893 893
 					{
894 894
 						if (!$content['acc_'.$type.'_ssl']) $content['acc_'.$type.'_ssl'] = 'no';
895 895
 					}
896 896
 				}
897
-				catch(Api\Exception\NotFound $e) {
897
+				catch (Api\Exception\NotFound $e) {
898 898
 					if (self::$debug) _egw_log_exception($e);
899 899
 					Framework::window_close(lang('Account not found!'));
900 900
 				}
901
-				catch(Exception $e) {
901
+				catch (Exception $e) {
902 902
 					if (self::$debug) _egw_log_exception($e);
903 903
 					Framework::window_close($e->getMessage().' ('.get_class($e).': '.$e->getCode().')');
904 904
 				}
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
 			elseif ($content['acc_id'] === 'new')
907 907
 			{
908 908
 				$content['account_id'] = $content['called_for'];
909
-				$content['old_acc_id'] = $content['acc_id'];	// to not call add/wizard, if we return from to
909
+				$content['old_acc_id'] = $content['acc_id']; // to not call add/wizard, if we return from to
910 910
 				unset($content['tabs']);
911 911
 				return $this->add($content);
912 912
 			}
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
 		{
917 917
 			if (!isset($content['account_id'])) $content['account_id'] = array($GLOBALS['egw_info']['user']['account_id']);
918 918
 			$content['acc_user_editable'] = $content['acc_further_identities'] = true;
919
-			$readonlys['ident_id'] = true;	// need to create standard identity first
919
+			$readonlys['ident_id'] = true; // need to create standard identity first
920 920
 		}
921 921
 		if (empty($content['acc_name']))
922 922
 		{
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
 		{
958 958
 			list($button) = each($content['button']);
959 959
 			unset($content['button']);
960
-			switch($button)
960
+			switch ($button)
961 961
 			{
962 962
 				case 'wizard':
963 963
 					// if we just came from wizard, go back to last page/step
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
 						{
991 991
 							$content['ident_id'] = Mail\Account::save_identity(array(
992 992
 								'account_id' => $content['called_for'] ? $content['called_for'] : $GLOBALS['egw_info']['user']['account_id'],
993
-							)+$content);
993
+							) + $content);
994 994
 							$content['identities'][$content['ident_id']] = Mail\Account::identity_name($content);
995 995
 							$msg = lang('Identity saved.');
996 996
 							if ($edit_access) $msg .= ' '.lang('Switch back to standard identity to save account.');
@@ -1094,17 +1094,17 @@  discard block
 block discarded – undo
1094 1094
 					catch (Horde_Imap_Client_Exception $e)
1095 1095
 					{
1096 1096
 						_egw_log_exception($e);
1097
-						$tpl->set_validation_error('acc_imap_admin_username', $msg=lang($e->getMessage()).($e->details?', '.lang($e->details):''));
1097
+						$tpl->set_validation_error('acc_imap_admin_username', $msg = lang($e->getMessage()).($e->details ? ', '.lang($e->details) : ''));
1098 1098
 						$msg_type = 'error';
1099
-						$content['tabs'] = 'admin.mailaccount.imap';	// should happen automatic
1099
+						$content['tabs'] = 'admin.mailaccount.imap'; // should happen automatic
1100 1100
 						break;
1101 1101
 					}
1102 1102
 					catch (Horde\ManageSieve\Exception\ConnectionFailed $e)
1103 1103
 					{
1104 1104
 						_egw_log_exception($e);
1105
-						$tpl->set_validation_error('acc_sieve_port', $msg=lang($e->getMessage()));
1105
+						$tpl->set_validation_error('acc_sieve_port', $msg = lang($e->getMessage()));
1106 1106
 						$msg_type = 'error';
1107
-						$content['tabs'] = 'admin.mailaccount.sieve';	// should happen automatic
1107
+						$content['tabs'] = 'admin.mailaccount.sieve'; // should happen automatic
1108 1108
 						break;
1109 1109
 					}
1110 1110
 					catch (Exception $e) {
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
 						$msg_type = 'error';
1114 1114
 					}
1115 1115
 					if ($content['acc_id']) Mail::unsetCachedObjects($content['acc_id']);
1116
-					if (stripos($msg,'fatal error:')!==false) $msg_type = 'error';
1116
+					if (stripos($msg, 'fatal error:') !== false) $msg_type = 'error';
1117 1117
 					Framework::refresh_opener($msg, 'emailadmin', $content['acc_id'], $new_account ? 'add' : 'update', null, null, null, $msg_type);
1118 1118
 					if ($button == 'save') Framework::window_close();
1119 1119
 					break;
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
 		if ($this->is_admin && (empty($content['acc_imap_username']) || empty($content['acc_imap_host']) || $content['called_for']))
1167 1167
 		{
1168 1168
 			// cant connection to imap --> allow free entries in taglists
1169
-			foreach(array('acc_folder_sent', 'acc_folder_trash', 'acc_folder_draft', 'acc_folder_template', 'acc_folder_junk') as $folder)
1169
+			foreach (array('acc_folder_sent', 'acc_folder_trash', 'acc_folder_draft', 'acc_folder_template', 'acc_folder_junk') as $folder)
1170 1170
 			{
1171 1171
 				$tpl->setElementAttribute($folder, 'allowFreeEntries', true);
1172 1172
 			}
@@ -1178,15 +1178,15 @@  discard block
 block discarded – undo
1178 1178
 					$sel_options['acc_folder_draft'] = $sel_options['acc_folder_template'] =
1179 1179
 					$sel_options['acc_folder_junk'] = $sel_options['acc_folder_archive'] =
1180 1180
 					$sel_options['notify_folders'] = $sel_options['acc_folder_ham'] =
1181
-						self::mailboxes(self::imap_client ($content));
1181
+						self::mailboxes(self::imap_client($content));
1182 1182
 			}
1183
-			catch(Exception $e) {
1183
+			catch (Exception $e) {
1184 1184
 				if (self::$debug) _egw_log_exception($e);
1185 1185
 				// let user know what the problem is and that he can fix it using wizard or deleting
1186 1186
 				$msg = lang($e->getMessage())."\n\n".lang('You can use wizard to fix account settings or delete account.');
1187 1187
 				$msg_type = 'error';
1188 1188
 				// cant connection to imap --> allow free entries in taglists
1189
-				foreach(array('acc_folder_sent', 'acc_folder_trash', 'acc_folder_draft', 'acc_folder_template', 'acc_folder_junk') as $folder)
1189
+				foreach (array('acc_folder_sent', 'acc_folder_trash', 'acc_folder_draft', 'acc_folder_template', 'acc_folder_junk') as $folder)
1190 1190
 				{
1191 1191
 					$tpl->setElementAttribute($folder, 'allowFreeEntries', true);
1192 1192
 				}
@@ -1259,7 +1259,7 @@  discard block
 block discarded – undo
1259 1259
 			$content['acc_smtp_type'] == 'EGroupware\\Api\\Mail\\Smtp';
1260 1260
 		if ($readonlys['tabs']['admin.mailaccount.aliases'])
1261 1261
 		{
1262
-			unset($sel_options['acc_further_identities'][2]);	// can limit identities to aliases without aliases ;-)
1262
+			unset($sel_options['acc_further_identities'][2]); // can limit identities to aliases without aliases ;-)
1263 1263
 		}
1264 1264
 
1265 1265
 		// allow smtp class to disable certain features in alias tab
@@ -1298,7 +1298,7 @@  discard block
 block discarded – undo
1298 1298
 		if ($content['called_for'] && $content['acc_id'] > 0)
1299 1299
 		{
1300 1300
 			$admin_actions = array();
1301
-			foreach(Api\Hooks::process(array(
1301
+			foreach (Api\Hooks::process(array(
1302 1302
 				'location' => 'emailadmin_edit',
1303 1303
 				'account_id' => $content['called_for'],
1304 1304
 				'acc_id' => $content['acc_id'],
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 		//try to fix identities with no domain part set e.g. alias as identity
1314 1314
 		if (!strpos($content['ident_email'], '@'))
1315 1315
 		{
1316
-			$content['ident_email'] = Mail::fixInvalidAliasAddress (Api\Accounts::id2name($content['acc_imap_account_id'], 'account_email'), $content['ident_email']);
1316
+			$content['ident_email'] = Mail::fixInvalidAliasAddress(Api\Accounts::id2name($content['acc_imap_account_id'], 'account_email'), $content['ident_email']);
1317 1317
 		}
1318 1318
 
1319 1319
 		$tpl->exec(static::APP_CLASS.'edit', $content, $sel_options, $readonlys, $content, 2);
@@ -1325,7 +1325,7 @@  discard block
 block discarded – undo
1325 1325
 	 * @param string|array &$account_id on return always array
1326 1326
 	 * @param boolean $back =false
1327 1327
 	 */
1328
-	private static function fix_account_id_0(&$account_id=null, $back=false)
1328
+	private static function fix_account_id_0(&$account_id = null, $back = false)
1329 1329
 	{
1330 1330
 		if (!isset($account_id)) return;
1331 1331
 
@@ -1333,7 +1333,7 @@  discard block
 block discarded – undo
1333 1333
 		{
1334 1334
 			$account_id = explode(',', $account_id);
1335 1335
 		}
1336
-		if (($k = array_search($back?'':'0', $account_id)) !== false)
1336
+		if (($k = array_search($back ? '' : '0', $account_id)) !== false)
1337 1337
 		{
1338 1338
 			$account_id[$k] = $back ? '0' : '';
1339 1339
 		}
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 	 * @param int $timeout =null default use value returned by Mail\Imap::getTimeOut()
1347 1347
 	 * @return Horde_Imap_Client_Socket
1348 1348
 	 */
1349
-	protected static function imap_client(array $content, $timeout=null)
1349
+	protected static function imap_client(array $content, $timeout = null)
1350 1350
 	{
1351 1351
 		return new Horde_Imap_Client_Socket(array(
1352 1352
 			'username' => $content['acc_imap_username'],
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
 	protected static function fix_ssl_order($data)
1369 1369
 	{
1370 1370
 		$ordered = array();
1371
-		foreach(array_merge(array('TLS', 'SSL', 'STARTTLS'), array_keys($data)) as $key)
1371
+		foreach (array_merge(array('TLS', 'SSL', 'STARTTLS'), array_keys($data)) as $key)
1372 1372
 		{
1373 1373
 			if (array_key_exists($key, $data)) $ordered[$key] = $data[$key];
1374 1374
 		}
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
 	 * @return array with values for keys 'displayName', 'imap', 'smtp', 'pop3', which each contain
1387 1387
 	 *	array of arrays with values for keys 'hostname', 'port', 'socketType'=(SSL|STARTTLS), 'username'=%EMAILADDRESS%
1388 1388
 	 */
1389
-	protected static function mozilla_ispdb($domain, $try_mx=true)
1389
+	protected static function mozilla_ispdb($domain, $try_mx = true)
1390 1390
 	{
1391 1391
 		if (strpos($domain, '@') !== false) list(,$domain) = explode('@', $domain);
1392 1392
 
@@ -1397,17 +1397,17 @@  discard block
 block discarded – undo
1397 1397
 			$provider = array(
1398 1398
 				'displayName' => (string)$xml->emailProvider->displayName,
1399 1399
 			);
1400
-			foreach($xml->emailProvider->children() as $tag => $server)
1400
+			foreach ($xml->emailProvider->children() as $tag => $server)
1401 1401
 			{
1402 1402
 				if (!in_array($tag, array('incomingServer', 'outgoingServer'))) continue;
1403
-				foreach($server->attributes() as $name => $value)
1403
+				foreach ($server->attributes() as $name => $value)
1404 1404
 				{
1405 1405
 					if ($name == 'type') $type = (string)$value;
1406 1406
 				}
1407 1407
 				$data = array();
1408
-				foreach($server as $name => $value)
1408
+				foreach ($server as $name => $value)
1409 1409
 				{
1410
-					foreach($value->children() as $tag => $val)
1410
+					foreach ($value->children() as $tag => $val)
1411 1411
 					{
1412 1412
 						$data[$name][$tag] = (string)$val;
1413 1413
 					}
@@ -1416,7 +1416,7 @@  discard block
 block discarded – undo
1416 1416
 				$provider[$type][] = $data;
1417 1417
 			}
1418 1418
 		}
1419
-		catch(Exception $e) {
1419
+		catch (Exception $e) {
1420 1420
 			// ignore own not-found exception or xml parsing execptions
1421 1421
 			unset($e);
1422 1422
 
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
 	 * @param string $type ='imap' 'imap' or 'smtp', used as hostname beside 'mail'
1449 1449
 	 * @return array of hostname => true pairs
1450 1450
 	 */
1451
-	protected function guess_hosts($email, $type='imap')
1451
+	protected function guess_hosts($email, $type = 'imap')
1452 1452
 	{
1453 1453
 		list(,$domain) = explode('@', $email);
1454 1454
 
@@ -1474,7 +1474,7 @@  discard block
 block discarded – undo
1474 1474
 		}
1475 1475
 
1476 1476
 		// verify hosts in dns
1477
-		foreach(array_keys($hosts) as $host)
1477
+		foreach (array_keys($hosts) as $host)
1478 1478
 		{
1479 1479
 			if (!dns_get_record($host, DNS_A)) unset($hosts[$host]);
1480 1480
 		}
@@ -1511,12 +1511,12 @@  discard block
 block discarded – undo
1511 1511
 				}
1512 1512
 
1513 1513
 				$ea_account = Mail\Account::read($emailadmin->acc_id, $_data['id']);
1514
-				if (($userData = $ea_account->getUserData ()))
1514
+				if (($userData = $ea_account->getUserData()))
1515 1515
 				{
1516 1516
 					$userData = array(
1517 1517
 						'acc_smtp_type' => $ea_account->acc_smtp_type,
1518 1518
 						'accountStatus' => $_data['status'],
1519
-						'quotaLimit' => $_data['qouta']? $_data['qouta']: $userData['qoutaLimit'],
1519
+						'quotaLimit' => $_data['qouta'] ? $_data['qouta'] : $userData['qoutaLimit'],
1520 1520
 						'mailLocalAddress' => $userData['mailLocalAddress']
1521 1521
 					);
1522 1522
 
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
 					{
1525 1525
 						$userData['mailLocalAddress'] = preg_replace('/@'.preg_quote($ea_account->acc_domain).'$/', '@'.$_data['domain'], $userData['mailLocalAddress']);
1526 1526
 
1527
-						foreach($userData['mailAlternateAddress'] as &$alias)
1527
+						foreach ($userData['mailAlternateAddress'] as &$alias)
1528 1528
 						{
1529 1529
 							$alias = preg_replace('/@'.preg_quote($ea_account->acc_domain).'$/', '@'.$_data['domain'], $alias);
1530 1530
 						}
@@ -1532,7 +1532,7 @@  discard block
 block discarded – undo
1532 1532
 					// fullfill the saveUserData requirements
1533 1533
 					$userData += $ea_account->params;
1534 1534
 					$ea_account->saveUserData($_data['id'], $userData);
1535
-					$msg = '#'.$_data['id'].' '.$account['account_fullname']. ' '.($userData['accountStatus'] == 'active'? lang('activated'):lang('deactivated'));
1535
+					$msg = '#'.$_data['id'].' '.$account['account_fullname'].' '.($userData['accountStatus'] == 'active' ? lang('activated') : lang('deactivated'));
1536 1536
 				}
1537 1537
 				else
1538 1538
 				{
Please login to merge, or discard this patch.