fixing some small php notice at install time
This commit is contained in:
		
							parent
							
								
									7ce145c2fa
								
							
						
					
					
						commit
						2a6eaf60f3
					
				|  | @ -9,6 +9,9 @@ function update_locale($langpath) { | ||||||
|       $locales[$mat[1]]=$mat[1]; |       $locales[$mat[1]]=$mat[1]; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |   if (!count($locales)) { | ||||||
|  |     $locales=array("en_US"=>"en_US"); | ||||||
|  |   } | ||||||
|   return $locales; |   return $locales; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -23,6 +26,11 @@ $langpath = bindtextdomain("alternc", "/var/alternc/bureau/locales"); | ||||||
| // Create or update a locale.php file if it is outdated.
 | // Create or update a locale.php file if it is outdated.
 | ||||||
| $locales = update_locale($langpath); | $locales = update_locale($langpath); | ||||||
| 
 | 
 | ||||||
|  | // Default to en_US : 
 | ||||||
|  | if (!isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) { | ||||||
|  |   $_SERVER["HTTP_ACCEPT_LANGUAGE"]="en_US"; | ||||||
|  | } | ||||||
|  | 
 | ||||||
| if (!(isset($lang))) {  // Use the browser first preferred language
 | if (!(isset($lang))) {  // Use the browser first preferred language
 | ||||||
|   $lang=strtolower(substr(trim($_SERVER["HTTP_ACCEPT_LANGUAGE"]),0,5)); |   $lang=strtolower(substr(trim($_SERVER["HTTP_ACCEPT_LANGUAGE"]),0,5)); | ||||||
| } | } | ||||||
|  | @ -39,7 +47,7 @@ if (! isset($locales[$lang])) { // Requested language not found in locales | ||||||
|   } |   } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| if (!isset($locales[$lang])) $lang=$locales[0];  | if (!isset($locales[$lang])) list($lang)=each($locales); | ||||||
| 
 | 
 | ||||||
| if (isset($setlang) && isset($lang)) { | if (isset($setlang) && isset($lang)) { | ||||||
|   setcookie("lang",$lang); |   setcookie("lang",$lang); | ||||||
|  |  | ||||||
|  | @ -140,6 +140,7 @@ class m_err { | ||||||
|     global $mem,$cuid; |     global $mem,$cuid; | ||||||
|     $f=@fopen($this->logfile,"ab"); |     $f=@fopen($this->logfile,"ab"); | ||||||
|     if ($f) { |     if ($f) { | ||||||
|  |       if (!isset($_SERVER['REMOTE_ADDR'])) $_SERVER['REMOTE_ADDR']="::1"; | ||||||
|       fputs($f,date("d/m/Y H:i:s")." - " . $_SERVER['REMOTE_ADDR'] . " - CALL - "); |       fputs($f,date("d/m/Y H:i:s")." - " . $_SERVER['REMOTE_ADDR'] . " - CALL - "); | ||||||
|       fputs($f,$mem->user["login"]." - "); |       fputs($f,$mem->user["login"]." - "); | ||||||
|       fputs($f,$clsid." - ".$function." - ".$param."\n"); |       fputs($f,$clsid." - ".$function." - ".$param."\n"); | ||||||
|  |  | ||||||
|  | @ -173,7 +173,7 @@ class m_quota { | ||||||
|     global $err,$db,$cuid; |     global $err,$db,$cuid; | ||||||
|     $err->log("quota","setquota",$ressource."/".$size); |     $err->log("quota","setquota",$ressource."/".$size); | ||||||
|     if (floatval($size)==0) $size="0"; |     if (floatval($size)==0) $size="0"; | ||||||
|     if ($this->disk[$ressource]) { |     if (isset($this->disk[$ressource])) { | ||||||
|       // It's a disk resource, update it with shell command
 |       // It's a disk resource, update it with shell command
 | ||||||
|       exec("/usr/lib/alternc/quota_edit $cuid $size"); |       exec("/usr/lib/alternc/quota_edit $cuid $size"); | ||||||
|       // Now we check that the value has been written properly : 
 |       // Now we check that the value has been written properly : 
 | ||||||
|  |  | ||||||
|  | @ -46,7 +46,7 @@ function variable_init($conf = array()) { | ||||||
|   while ($db->next_record($result)) { |   while ($db->next_record($result)) { | ||||||
|     /* maybe the data is *not* serialized, in that case, take it verbatim */ |     /* maybe the data is *not* serialized, in that case, take it verbatim */ | ||||||
|     $variable = $db->Record; |     $variable = $db->Record; | ||||||
|     if (($variables[$variable['name']] = unserialize($variable['value'])) === FALSE) { |     if (($variables[$variable['name']] = @unserialize($variable['value'])) === FALSE) { | ||||||
|       $variables[$variable['name']] = $variable['value']; |       $variables[$variable['name']] = $variable['value']; | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Benjamin Sonntag
						Benjamin Sonntag