Changeset 5064 for extensions/NBC_UserAdvManager/trunk/include
- Timestamp:
- Mar 6, 2010, 7:37:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/include/functions.inc.php
r5056 r5064 7 7 { 8 8 /* Only available for next Piwigo release (bug in switch_lang function) */ 9 //global $conf; 10 11 /* ****************************************************************** */ 12 /* Delete this after new Piwigo release (bug in switch_lang function) */ 13 global $conf, $user; 14 $save_user = $user; 15 /* ****************************************************************** */ 9 global $conf; 16 10 17 11 $conf_UAM = unserialize($conf['nbc_UserAdvManager']); … … 122 116 123 117 /* Switching back to default language */ 124 /* ****************************************************************** */125 /* Delete this after new Piwigo release (bug in switch_lang function) */126 $user=$save_user ;127 /* ****************************************************************** */128 118 switch_lang_back(); 129 119 } … … 134 124 { 135 125 /* Only available for next Piwigo release (bug in switch_lang function) */ 136 //global $conf; 137 138 /* ****************************************************************** */ 139 /* Delete this after new Piwigo release (bug in switch_lang function) */ 140 global $conf, $user; 141 $save_user = $user; 142 /* ****************************************************************** */ 126 global $conf; 143 127 144 128 $conf_UAM = unserialize($conf['nbc_UserAdvManager']); … … 234 218 235 219 /* Switching back to default language */ 236 /* ****************************************************************** */237 /* Delete this after new Piwigo release (bug in switch_lang function) */238 $user=$save_user ;239 /* ****************************************************************** */240 220 switch_lang_back(); 241 221 } … … 246 226 { 247 227 /* Only available for next Piwigo release (bug in switch_lang function) */ 248 //global $conf; 249 250 /* ****************************************************************** */ 251 /* Delete this after new Piwigo release (bug in switch_lang function) */ 252 global $conf, $user; 253 $save_user = $user; 254 /* ****************************************************************** */ 228 global $conf; 255 229 256 230 $conf_UAM = unserialize($conf['nbc_UserAdvManager']); … … 306 280 307 281 /* Switching back to default language */ 308 /* ****************************************************************** */309 /* Delete this after new Piwigo release (bug in switch_lang function) */310 $user=$save_user ;311 /* ****************************************************************** */312 282 switch_lang_back(); 313 283 } … … 500 470 501 471 /* Time limit process */ 502 /* ****************** begin******************* */472 /* ******************************************** */ 503 473 if (!empty($registration_date)) 504 474 { … … 985 955 986 956 /* Time limit process */ 987 /* ****************** begin******************* */957 /* ******************************************** */ 988 958 if (!empty($registration_date)) 989 959 { … … 1106 1076 fwrite($fo, 'Langue : '."\n" . $language . "\r\n") ; 1107 1077 fclose($fo) ; 1108 //return mail ($to,$subject) ;1078 //return mail ($to,$subject) ; 1109 1079 } 1110 1080 … … 1155 1125 } 1156 1126 1157 /* Funtion called in maintain.inc.php to clean obsolete files */ 1158 function clean_obsolete_files($obsolete_file_list) 1159 { 1160 if (!file_exists(NBC_UAM_PATH.$obsolete_file_list)) 1161 { 1162 return TRUE; 1163 } 1164 $obsolete = file(NBC_UAM_PATH.$obsolete_file_list); 1165 array_push($obsolete, $obsolete_file_list); 1166 return clean_obsolete_list($obsolete); 1167 } 1168 1169 function clean_obsolete_list($file_list = array(), &$errors = array()) 1170 { 1171 if (!function_exists('unlink')) 1172 { 1173 // No unlink available... 1174 array_push($errors, l10n('uam_no_unlink')); 1175 return FALSE; 1176 } 1177 $success = TRUE; 1178 foreach ($file_list as $file) 1179 { 1180 $file = NBC_UAM_PATH . $file; 1181 $to = ''; 1182 $subject =''; 1183 $language = ''; 1184 MailLog ($to, $subject, $file, $language); 1185 //if (file_exists($file)) 1186 //{ 1187 // Remove obsolete file 1188 $success &= unlink($file); 1189 $to = ''; 1190 $subject =''; 1191 $language = ''; 1192 MailLog ($to, $subject, $file, $success); 1193 //} 1194 } 1195 if (!$success) 1196 { 1197 array_push($errors, l10n('uam_unlink_errors')); 1198 } 1199 return $success; 1127 1128 function clean_obsolete_files() 1129 { 1130 if (file_exists(NBC_UAM_PATH.'obsolete.list') 1131 and $old_files = file(NBC_UAM_PATH.'obsolete.list', FILE_IGNORE_NEW_LINES) 1132 and !empty($old_files)) 1133 { 1134 array_push($old_files, 'obsolete.list'); 1135 foreach($old_files as $old_file) 1136 { 1137 $path = NBC_UAM_PATH.$old_file; 1138 if (is_file($path)) 1139 { 1140 @unlink($path); 1141 } 1142 } 1143 } 1200 1144 } 1201 1145 ?>
Note: See TracChangeset
for help on using the changeset viewer.