*** empty log message ***

svn path=/trunk/boinc/; revision=5556
This commit is contained in:
David Anderson 2005-03-03 19:36:32 +00:00
parent 77411a83ab
commit f949aa0e35
4 changed files with 63 additions and 5 deletions

View File

@ -25472,3 +25472,17 @@ Bruce 3 March 2005
manage_special_users.php
manage_special_users_action.php
David 3 Mar 2005
- typo in translation.inc (wrong date format in log file)
- db_update.php must be run from command line,
and gets user name/password interactively
instead of from config file
(from Eric Myers)
html/
inc/
ops.inc (new)
translation.inc
ops/
db_update.php

43
html/inc/ops.inc Normal file
View File

@ -0,0 +1,43 @@
<?
// Only allow this script to run from the command line
//
function cli_only(){
if (array_key_exists("SERVER_PORT", $_SERVER)) {
die("<html><h1>
This script is intended to be run from the command line,
not from the web server!
</h1>"
);
}
}
// initialize database connection with username & password from
// command line instead of config.xml
//
function db_init_cli() {
$config = get_config();
$db_name = parse_config($config, "<db_name>");
$host = parse_config($config, "<db_host>");
if ($host == null) {
$host = "localhost";
}
$in = fopen("php://stdin","r");
print "Database username for $db_name@$host: ";
ob_flush();
$user = rtrim(fgets($in, 80));
print "Database password for $db_name@host: ";
ob_flush();
$pass = rtrim(fgets($in, 80));
$retval = mysql_pconnect($host, $user, $pass);
if (!$retval) {
return 1;
}
if(!mysql_select_db($db_name)) {
return 2;
}
return 0;
}
?>

View File

@ -238,8 +238,7 @@ function getPOLineContent($line){
function tr($tokennumber){
global $language_lookup_array, $default_language_lookup_array;
if (strval(intval($tokennumber))!=$tokennumber){
echo "Language token used which is not defined in language interface! DEVELOPER: please check your spelling or add the token to the interface (usually the project default language file).";
echo "<br>If you are a user of this system please contact an administrator right away and tell what URL you got this error on";
echo "token $tokennumber missing from language interface.";
}
if (array_key_exists($tokennumber,$language_lookup_array)){ //If language has got the token
@ -261,7 +260,7 @@ function language_log($message, $loglevel=0){
if ($loglevel>=$lang_log_level){
$fh = fopen($lang_log_file,"a");
fwrite($fh, date("Y-m-d H:m:s",time())." ".$msg." ".$message."\n");
fwrite($fh, date("Y-m-d H:i:s",time())." ".$msg." ".$message."\n");
fclose($fh);
}
}
@ -291,4 +290,4 @@ if (file_exists($lang_language_dir.$lang_compiled_dir."language_interface.inc"))
echo "ERROR: Could not load language interface. This is a fatal error, exitting."; flush; exit;
};
?>
?>

View File

@ -6,8 +6,10 @@
require_once("../inc/db.inc");
require_once("../inc/util.inc");
require_once("../inc/ops.inc");
db_init();
cli_only();
db_init_cli();
set_time_limit(0);