4 include_once(
"./setup/classes/class.ilDBConnections.php");
 
   76                 define(
"ILIAS_MODULE",
"setup");
 
   78                 $this->auth = ($a_auth) ? 
true : 
false;
 
   79                 $this->access_mode = $a_auth_type;
 
   82                 if ($this->safe_mode = ini_get(
"safe_mode"))
 
   96                 $this->ini_ilias_exists = $this->
init();
 
   98                 if ($this->ini_ilias_exists)
 
  100                         if ($this->ini->readVariable(
"log",
"path") != 
"")
 
  102                                 $log->path = $this->ini->readVariable(
"log",
"path");
 
  105                         if ($this->ini->readVariable(
"log",
"file") != 
"")
 
  107                                 $log->filename = $this->ini->readVariable(
"log",
"file");
 
  110                         if ($this->ini->readVariable(
"log",
"enabled") != 
"")
 
  112                                 $log->enabled = $this->ini->readVariable(
"log",
"enabled");
 
  124                 $this->client = $a_cl;
 
  145                 $this->ini = 
new ilIniFile($this->ini_file_path);
 
  147                 if (!$this->ini->read())
 
  149                         $this->ini->GROUPS = parse_ini_file($this->setup_defaults,
true);
 
  150                         $this->error = get_class($this).
": ".$this->ini->getError();
 
  154                 $this->setup_password = $this->ini->readVariable(
"setup",
"pass");
 
  155                 $this->default_client = $this->ini->readVariable(
"clients",
"default");
 
  157                 define(
"ILIAS_DATA_DIR",$this->ini->readVariable(
"clients",
"datadir"));
 
  158                 define(
"ILIAS_WEB_DIR",$this->ini->readVariable(
"clients",
"path"));
 
  170                 $_SESSION[
"ClientId"] = $this->client->getId();
 
  173                 if (!$this->client->create())
 
  175                         $this->error = $this->client->getError();
 
  180                 $this->ini_client_exists = 
true;
 
  195                 if ($a_old_client_id != $this->client->getId())
 
  200                                 $this->
raiseError($this->lng->txt(
"client_id_already_exists"),$this->error_obj->MESSAGE);
 
  205                                 $this->
raiseError($this->lng->txt(
"save_error"),$this->error_obj->MESSAGE);
 
  213                 $this->ini_client_exists = 
true;
 
  224                 if ($this->client->checkDatabaseExists())
 
  226                         $this->error = $this->lng->txt(
"database_exists");
 
  230                 $this->client->getDB()->connectHost(
true);
 
  233                 $db = $this->client->getDB();
 
  236                         $this->error = 
"connection_failed";
 
  240                 $r = 
$db->createDatabase($this->client->getdbName(),
 
  241                         "utf8", $a_collation);
 
  245                         $this->error = 
"create_database_failed";
 
  252                 $this->client->db_exists = 
true;
 
  268                 if (!$this->client->connect())
 
  274                 if ($this->
readDump($this->client->db, $this->SQL_FILE))
 
  276                         $this->client->db_installed = 
true;
 
  288                 while( !feof( $fp ) )
 
  307                 if (
$db->getDBType() == 
"mysql")
 
  309                         $fp = fopen(
$file, 
'r');
 
  314                                 $line = trim($this->
getline($fp, 
"\n"));
 
  316                                 if ($line != 
"" && substr($line,0,1)!=
"#" 
  317                                         && substr($line,0,1)!=
"-")
 
  320                                         if (substr($line,-1)==
";")
 
  323                                                 $q .= 
" ".substr($line,0,-1);
 
  325                                                 if (mysql_errno() > 0)
 
  327                                                         echo 
"<br />ERROR: ".mysql_error().
 
  344                 #echo 'Start Memory: '.memory_get_usage().' peak: '.memory_get_peak_usage(); 
  345                 if (
$db->getDBType() == 
"oracle")
 
  347                         if(@is_dir(
'./setup/sql/ilDBTemplate'))
 
  349                                 include_once 
'./Services/Database/classes/class.ilArrayTableDataParser.php';
 
  350                                 include_once 
'./classes/class.ilSaxParserException.php';
 
  354                                         eval(file_get_contents(
'./setup/sql/ilDBTemplate/'.$file));
 
  358                                                 #$parser = new ilSimpleXMLTableDataParser('./setup/sql/ilDBTemplate/'.$file.'.xml'); 
  359                                                 $parser->startParsing();
 
  360                                                 #echo 'Table: '.$file.', memory: '.memory_get_peak_usage().' peak: '.memory_get_peak_usage().'<br />';flush(); 
  371                                 include_once(
"./setup/sql/ilDBTemplate.php");
 
  372                                 setupILIASDatabase();
 
  375                 #echo 'Start Memory: '.memory_get_usage().' peak: '.memory_get_peak_usage(); 
  386                 $a = @file_exists($this->INI_FILE);
 
  398                 if (is_writable(
"."))
 
  400                         $arr[
"status"] = 
true;
 
  403                         $arr[
"comment"] = getcwd();
 
  408                         $arr[
"status"] = 
false;
 
  409                         $arr[
"comment"] = $this->lng->txt(
"pre_folder_write_error");
 
  412                         $arr[
"comment"] = getcwd().
": ".$arr[
"comment"];
 
  427                 if (@mkdir($a_dir.
"/crst879dldsk9d", 0774))
 
  429                         $arr[
"status"] = 
true;
 
  430                         $arr[
"comment"] = 
"";
 
  432                         @rmdir($a_dir.
"/crst879dldsk9d");
 
  436                         $arr[
"status"] = 
false;
 
  439                         $arr[
"comment"] = getcwd().
": ".$this->lng->txt(
"pre_folder_create_error");
 
  454                 if ($sess->usesCookies)
 
  456                         $arr[
"status"] = 
true;
 
  457                         $arr[
"comment"] = 
"";
 
  461                         $arr[
"status"] = 
false;
 
  462                         $arr[
"comment"] = $this->lng->txt(
"pre_cookies_disabled");
 
  474                 $version =  PHP_VERSION;
 
  476                 $arr[
"status"] = 
true;
 
  477                 $arr[
"comment"] = 
"PHP ".$version;
 
  478                 if (version_compare($version, 
'5.1.3', 
'<'))
 
  480                         $arr[
"status"] = 
false;
 
  481                         $arr[
"comment"] = 
"PHP ".$version.
". ".$this->lng->txt(
"pre_php_version_too_low");
 
  495                 if (function_exists(
"mysql_query"))
 
  497                         $arr[
"status"] = 
true;
 
  498                         $arr[
"comment"] = $this->lng->txt(
"pre_mysql_4_1_or_higher");
 
  502                         $arr[
"status"] = 
false;
 
  503                         $arr[
"comment"] = $this->lng->txt(
"pre_mysql_missing");
 
  532                 if (class_exists(
"DOMDocument"))
 
  534                         $arr[
"status"] = 
true;
 
  538                         $arr[
"status"] = 
false;
 
  539                         $arr[
"comment"] = $this->lng->txt(
"pre_dom_missing");
 
  553                 if (class_exists(
"XSLTProcessor"))
 
  555                         $arr[
"status"] = 
true;
 
  559                         $arr[
"status"] = 
false;
 
  560                         $arr[
"comment"] = sprintf($this->lng->txt(
"pre_xsl_missing"),
 
  561                                 "http://php.net/manual/en/book.xsl.php");
 
  575                 if (function_exists(
"imagefill") && function_exists(
"imagecolorallocate"))
 
  577                         $arr[
"status"] = 
true;
 
  581                         $arr[
"status"] = 
false;
 
  582                         $arr[
"comment"] = sprintf($this->lng->txt(
"pre_gd_missing"),
 
  583                                 "http://php.net/manual/en/book.image.php");
 
  597                 $limit = ini_get(
"memory_limit");
 
  600                 if (is_int(strpos($limit, 
"M")))
 
  602                         $limit_n = (int) $limit;
 
  611                         $arr[
"status"] = 
true;
 
  612                         $arr[
"comment"] = $limit.
". ".$this->lng->txt(
"pre_memory_limit_recommend");
 
  616                         $arr[
"status"] = 
false;
 
  617                         $arr[
"comment"] = $limit.
". ".$this->lng->txt(
"pre_memory_limit_too_low");
 
  654                 foreach ($this->preliminaries_result as $val)
 
  656                         if ($val[
"status"] === 
false)
 
  658                                 $this->preliminaries = 
false;
 
  672                 return $this->ini->readVariable(
"setup",
"pass");
 
  682                 $this->ini->setVariable(
"setup",
"pass",md5($a_password));
 
  684                 if ($this->ini->write() == 
false)
 
  686                         $this->error = $this->ini->getError();
 
  702                 if (empty($a_auth_data[
"client_id"]))
 
  704                         $this->error = 
"no_client_id";
 
  708                 if (empty($a_auth_data[
"username"]))
 
  710                         $this->error = 
"no_username";
 
  714                 if (empty($a_auth_data[
"password"]))
 
  716                         $this->error = 
"no_password";
 
  720                 if (!$this->
newClient($a_auth_data[
"client_id"]))
 
  722                         $this->error = 
"unknown_client_id";
 
  723                         unset($this->client);
 
  727                 if (!$this->client->db_exists)
 
  729                         $this->error = 
"no_db_connect_consult_admin";
 
  730                         unset($this->client);
 
  734                 $s1 = $this->client->db->query(
"SELECT value from settings WHERE keyword = ".
 
  735                         $this->client->db->quote(
'system_role_id',
'text'));
 
  736                 $r1 = $this->client->db->fetchAssoc($s1);
 
  737                 $system_role_id = $r1[
"value"];
 
  738                 $q = 
"SELECT usr_data.usr_id FROM usr_data ".
 
  739                          "LEFT JOIN rbac_ua ON rbac_ua.usr_id=usr_data.usr_id ".
 
  740                          "WHERE rbac_ua.rol_id = ".$this->client->db->quote((
int) $system_role_id,
'integer').
" ".
 
  741                          "AND usr_data.login=".$this->client->db->quote($a_auth_data[
"username"],
'text').
" ".
 
  742                          "AND usr_data.passwd=".$this->client->db->quote(md5($a_auth_data[
"password"]),
'text');
 
  744                 $r = $this->client->db->query($q);
 
  748                         $this->error = 
"login_invalid";
 
  755                 $_SESSION[
"ClientId"] = $this->client->getId();         
 
  766                 $a_password = md5($a_password);
 
  768                 if ($this->ini->readVariable(
"setup",
"pass") == $a_password)
 
  790                 $this->client = 
new ilClient($a_client_id, $this->db_connections);
 
  792                 if (!$this->client->init())
 
  795                         $this->error = get_class($this).
": ".$this->client->getError();
 
  814                         if ($this->ini_client_exists)
 
  828                 if ($status[
"db"][
"status"] === 
false and $status[
"db"][
"update"] !== 
true)
 
  832                         $status[
"lang"][
"status"] = 
false;
 
  833                         $status[
"lang"][
"comment"] = $status[
"db"][
"comment"];
 
  834                         $status[
"contact"][
"status"] = 
false;
 
  835                         $status[
"contact"][
"comment"] = $status[
"db"][
"comment"];
 
  836                         $status[
"nic"][
"status"] = 
false;
 
  837                         $status[
"nic"][
"comment"] = $status[
"db"][
"comment"];
 
  860                 if (
$client->getSetting(
"setup_ok"))
 
  862                         $arr[
"status"] = 
true;
 
  867                         $arr[
"status"] = 
false;
 
  868                         $arr[
"comment"] = $this->lng->txt(
"setup_not_finished");
 
  881                 if (
$client->ini->readVariable(
"client",
"access") == 
"1")
 
  883                         $arr[
"status"] = 
true;
 
  884                         $arr[
"comment"] = $this->lng->txt(
"online");
 
  888                         $arr[
"status"] = 
false;
 
  889                         $arr[
"comment"] = $this->lng->txt(
"disabled");
 
  902                 if (!$arr[
"status"] = 
$client->init())
 
  904                         $arr[
"comment"] = 
$client->getError();
 
  921                 if (!$arr[
"status"] = 
$client->db_exists)
 
  923                         $arr[
"comment"] = $this->lng->txt(
"no_database");
 
  927                 if (!$arr[
"status"] = 
$client->db_installed)
 
  929                         $arr[
"comment"] = $this->lng->txt(
"db_not_installed");
 
  937                 include_once 
"./Services/Database/classes/class.ilDBUpdate.php";
 
  939                 $this->lng->setDbHandler(
$client->db);
 
  942                 if (!$arr[
"status"] = $dbupdate->getDBVersionStatus())
 
  944                         $arr[
"comment"] = $this->lng->txt(
"db_needs_update");
 
  945                         $arr[
"update"] = 
true;
 
  948                 else if ($dbupdate->hotfixAvailable())
 
  950                         $arr[
"status"] = 
false;
 
  951                         $arr[
"comment"] = $this->lng->txt(
"hotfix_available");
 
  952                         $arr[
"update"] = 
true;
 
  958                 $cset = 
$ilDB->query(
"SELECT count(*) as cnt FROM ctrl_calls");
 
  959                 $crec = 
$ilDB->fetchAssoc($cset);
 
  960                 if ($crec[
"cnt"] == 0)
 
  962                         $arr[
"status"] = 
false;
 
  963                         $arr[
"comment"] = $this->lng->txt(
"db_control_structure_missing");
 
  964                         $arr[
"update"] = 
true;
 
  979                 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
 
  986                 $query = 
"SELECT keyword, value FROM settings WHERE ".$db->in(
'keyword', $fields, 
false, 
'text');
 
  992                         if( 
$row[
'value'] != 
'' )
 
  997                 if (count($rows) != count($fields))
 
  999                         if($a_as_bool) 
return false;
 
 1000                         $arr[
"status"] = 
false;
 
 1001                         $arr[
"comment"] = $this->lng->txt(
"session_management_not_configured");
 
 1005                         if($a_as_bool) 
return true;
 
 1006                         $arr[
"status"] = 
true;
 
 1007                         $arr[
"comment"] = $this->lng->txt(
"session_management_configured");
 
 1020                 $installed_langs = $this->lng->getInstalledLanguages();
 
 1022                 $count = count($installed_langs);
 
 1026                         $arr[
"status"] = 
false;
 
 1027                         $arr[
"comment"] = $this->lng->txt(
"lang_none_installed");               
 
 1031                         $arr[
"status"] = 
true;
 
 1045                 $arr[
"status"] = 
true;
 
 1048                 $settings = 
$client->getAllSettings();
 
 1049                 $client_name = 
$client->getName();
 
 1052                 if (empty($settings[
"admin_firstname"]) or empty($settings[
"admin_lastname"]) or
 
 1053                         empty($settings[
"admin_email"]) or empty($client_name))
 
 1055                         $arr[
"status"] = 
false;
 
 1056                         $arr[
"comment"] = $this->lng->txt(
"missing_data");
 
 1060                 if (!
ilUtil::is_email($settings[
"admin_email"]) and $arr[
"status"] != 
false)
 
 1062                         $arr[
"status"] = 
false;
 
 1063                         $arr[
"comment"] = $this->lng->txt(
"email_not_valid");
 
 1076                 $settings = 
$client->getAllSettings();
 
 1078                 if (!isset($settings[
"nic_enabled"]))
 
 1080                         $arr[
"status"] = 
false;
 
 1081                         $arr[
"comment"] = $this->lng->txt(
"nic_not_disabled");
 
 1085                 $arr[
"status"] = 
true;
 
 1087                 if ($settings[
"nic_enabled"] == 
"-1")
 
 1089                         $arr[
"comment"] = $this->lng->txt(
"nic_reg_failed");
 
 1093                 if (!$settings[
"nic_enabled"])
 
 1095                         $arr[
"comment"] = $this->lng->txt(
"nic_reg_disabled");
 
 1099                         $arr[
"comment"] = $this->lng->txt(
"nic_reg_enabled");
 
 1100                         if ($settings[
"inst_id"] <= 0)
 
 1102                                 $arr[
"status"] = 
false;
 
 1133                 return ($this->access_mode == 
"admin") ? 
true : 
false;
 
 1145                 if ($a_formdata[
"chk_datadir_path"] == 1)       
 
 1149                                 $this->error = 
"create_datadir_failed";
 
 1159                                 $this->error = 
"create_webdir_failed";
 
 1165                 $log_path = substr($form_log_path,0,strrpos($form_log_path,
"/"));
 
 1166                 $log_file = substr($form_log_path,strlen($log_path)+1);
 
 1168                 $this->ini->setVariable(
"server",
"http_path",ILIAS_HTTP_PATH);
 
 1170                 $this->ini->setVariable(
"server",
"timezone",preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"time_zone"])));
 
 1171                 $this->ini->setVariable(
"clients", 
"datadir", $datadir_path);
 
 1172                 $this->ini->setVariable(
"tools", 
"convert", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"convert_path"])));
 
 1173                 $this->ini->setVariable(
"tools", 
"zip", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"zip_path"])));
 
 1174                 $this->ini->setVariable(
"tools", 
"unzip", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"unzip_path"])));
 
 1175                 $this->ini->setVariable(
"tools", 
"java", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"java_path"])));
 
 1176                 $this->ini->setVariable(
"tools", 
"htmldoc", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"htmldoc_path"])));
 
 1177                 $this->ini->setVariable(
"tools", 
"mkisofs", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"mkisofs_path"])));
 
 1179                 $this->ini->setVariable(
"tools", 
"vscantype", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"vscanner_type"])));
 
 1180                 $this->ini->setVariable(
"tools", 
"scancommand", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"scan_command"])));
 
 1181                 $this->ini->setVariable(
"tools", 
"cleancommand", preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"clean_command"])));
 
 1182                 $this->ini->setVariable(
"setup", 
"pass", md5($a_formdata[
"setup_pass"]));
 
 1183                 $this->ini->setVariable(
"log", 
"path", $log_path);
 
 1184                 $this->ini->setVariable(
"log", 
"file", $log_file);
 
 1185                 $this->ini->setVariable(
"log", 
"enabled", (isset($a_formdata[
"chk_log_status"])) ? 
"0" : 1);
 
 1187                 if (!$this->ini->write())
 
 1189                         $this->error = get_class($this).
": ".$this->ini->getError();
 
 1217                 $clean_command = preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"clean_command"]));
 
 1219                 $this->ini->setVariable(
"tools", 
"convert", $convert_path);
 
 1220                 $this->ini->setVariable(
"tools", 
"zip", $zip_path);
 
 1221                 $this->ini->setVariable(
"tools", 
"unzip", $unzip_path);
 
 1222                 $this->ini->setVariable(
"tools", 
"java", $java_path);
 
 1223                 $this->ini->setVariable(
"tools", 
"htmldoc", $htmldoc_path);
 
 1224                 $this->ini->setVariable(
"tools", 
"mkisofs", $mkisofs_path);
 
 1225                 $this->ini->setVariable(
"tools", 
"latex", $latex_url);
 
 1226                 $this->ini->setVariable(
"tools", 
"fop", $fop_path);
 
 1227                 $this->ini->setVariable(
"tools", 
"vscantype", $scan_type);
 
 1228                 $this->ini->setVariable(
"tools", 
"scancommand", $scan_command);
 
 1229                 $this->ini->setVariable(
"tools", 
"cleancommand", $clean_command);
 
 1232                 $log_path = substr($form_log_path,0,strrpos($form_log_path,
"/"));
 
 1233                 $log_file = substr($form_log_path,strlen($log_path)+1);
 
 1235                 $this->ini->setVariable(
"log", 
"path", $log_path);
 
 1236                 $this->ini->setVariable(
"log", 
"file", $log_file);
 
 1237                 $this->ini->setVariable(
"log", 
"enabled", ($a_formdata[
"chk_log_status"]) ? 
"0" : 1);
 
 1238                 $this->ini->setVariable(
"server",
"timezone",preg_replace(
"/\\\\/",
"/",
ilUtil::stripSlashes($a_formdata[
"time_zone"])));
 
 1240                 if (!$this->ini->write())
 
 1242                         $this->error = get_class($this).
": ".$this->ini->getError();
 
 1257                 if (!isset($a_formdata[
"chk_convert_path"]))
 
 1262                         if (($err = $this->
testConvert($convert_path)) != 
"")
 
 1264                                 $this->error = $err;
 
 1270                 if (!isset($a_formdata[
"chk_zip_path"]))
 
 1275                         if (empty($zip_path))
 
 1277                                 $this->error = 
"no_path_zip";
 
 1281                         if (!$this->
testZip($zip_path))
 
 1283                                 $this->error = 
"check_failed_zip";
 
 1289                 if (!isset($a_formdata[
"chk_unzip_path"]))
 
 1294                         if (empty($unzip_path))
 
 1296                                 $this->error = 
"no_path_unzip";
 
 1302                                 $this->error = 
"check_failed_unzip";
 
 1308                 if (!isset($a_formdata[
"chk_java_path"]))
 
 1313                         if (empty($java_path))
 
 1315                                 $this->error = 
"no_path_java";
 
 1321                                 $this->error = 
"check_failed_java";
 
 1327                 if (!isset($a_formdata[
"chk_htmldoc_path"]))
 
 1332                         if (empty($htmldoc_path))
 
 1334                                 $this->error = 
"no_path_htmldoc";
 
 1340                                 $this->error = 
"check_failed_htmldoc";
 
 1344                 if (!isset($a_formdata[
"chk_mkisofs_path"]))
 
 1349                         if (empty($mkisofs_path))
 
 1351                                 $this->error = 
"no_path_mkisofs";
 
 1357                                 $this->error = 
"check_failed_mkisofs";
 
 1363                 if (!isset($a_formdata[
"chk_latex_url"]))
 
 1366                         if (empty($latex_url))
 
 1368                                 $this->error = 
"no_latex_url";
 
 1374                                 $this->error = 
"check_failed_latex";
 
 1392                 if (empty($datadir_path))
 
 1394                         $this->error = 
"no_path_datadir";
 
 1401                 if (strpos($datadir_path,$webspace_dir) !== 
false)
 
 1403                         $this->error = 
"datadir_webspacedir_match";
 
 1408                 if ($a_formdata[
"chk_datadir_path"] == 1)
 
 1410                         $dir_to_create = substr(strrchr($datadir_path, 
"/"), 1);
 
 1411                         $dir_to_check = substr($datadir_path,0,- strlen($dir_to_create)-1);
 
 1413                         if (is_writable($datadir_path))
 
 1415                                 $this->error = 
"dir_exists_create";
 
 1419                         if (!is_writable($dir_to_check))
 
 1421                                 $this->error = 
"cannot_create_datadir_no_write_access";
 
 1427                         if (!is_writable($datadir_path))
 
 1429                                 $this->error = 
"cannot_create_datadir_no_write_access";
 
 1444                 if (!$a_formdata[
"setup_pass"])
 
 1446                         $this->error = 
"no_setup_pass_given";
 
 1450                 if ($a_formdata[
"setup_pass"] != $a_formdata[
"setup_pass2"])
 
 1452                         $this->error = 
"pass_does_not_match";
 
 1467                 if (!$a_formdata[
"chk_log_status"])
 
 1472                         if (empty($log_path))
 
 1474                                 $this->error = 
"no_path_log";
 
 1478                         if (!@touch($log_path))
 
 1480                                 $this->error = 
"could_not_create_logfile";
 
 1494                 if (empty($this->error))
 
 1527                 if (trim($a_convert_path) == 
"")
 
 1529                         return "no_path_convert";
 
 1531                 if (!is_file($a_convert_path))
 
 1533                         return "check_failed_convert";
 
 1569                 if (trim($a_java_path) == 
"")
 
 1574                 if (!is_file($a_java_path))
 
 1576                         return "check_failed_java";
 
 1598                 if (trim($a_latex_url) == 
"")
 
 1604                 include_once 
"./setup/classes/class.ilHttpRequest.php";
 
 1606                 $result = @$http->downloadToString();
 
 1607                 if ((strpos((substr(
$result, 0, 5)), 
"PNG") !== FALSE) || (strpos((substr(
$result, 0, 5)), 
"GIF") !== FALSE))
 
 1613                         return "check_failed_latex";;
 
 1625                 if (trim($a_zip_path) == 
"")
 
 1627                         return "no_path_zip";
 
 1629                 if (!is_file($a_zip_path))
 
 1631                         return "check_failed_zip";
 
 1678                 if (trim($a_unzip_path) == 
"")
 
 1680                         return "no_path_unzip";
 
 1682                 if (!is_file($a_unzip_path))
 
 1684                         return "check_failed_unzip";
 
 1724                 if (trim($a_htmldoc_path) == 
"")
 
 1729                 if (!is_file($a_htmldoc_path))
 
 1731                         return "check_failed_htmldoc";
 
 1741                 $html = 
"<html><head><title></title></head><body><p>test</p></body></html>";
 
 1743                 $html_file = 
"htmldoc_test_file.html";
 
 1745         $fp = fopen( $html_file ,
"wb");
 
 1749         $htmldoc = $a_htmldoc_path.
" ";
 
 1750         $htmldoc .= 
"--no-toc ";
 
 1751         $htmldoc .= 
"--no-jpeg ";
 
 1752         $htmldoc .= 
"--webpage ";
 
 1753         $htmldoc .= 
"--outfile htmldoc_test_file.pdf ";
 
 1754         $htmldoc .= 
"--bodyfont Arial ";
 
 1755         $htmldoc .= 
"--charset iso-8859-15 ";
 
 1756         $htmldoc .= 
"--color ";
 
 1757         $htmldoc .= 
"--size A4  ";      
 
 1758         $htmldoc .= 
"--format pdf ";
 
 1759         $htmldoc .= 
"--footer ... ";
 
 1760         $htmldoc .= 
"--header ... ";
 
 1761         $htmldoc .= 
"--left 60 ";
 
 1763         $htmldoc .= $html_file;
 
 1788         function unzip($a_file, $overwrite = 
false)
 
 1792                 $pathinfo = pathinfo($a_file);
 
 1793                 $dir = $pathinfo[
"dirname"];
 
 1794                 $file = $pathinfo[
"basename"];
 
 1799                 $unzip = $this->ini->readVariable(
"tools",
"unzip");
 
 1801                 exec($unzipcmd, $arr);
 
 1804                 foreach($arr as $line)
 
 1806                         if(is_int(strpos($line, 
"/")))
 
 1808                                 $zdir = substr($line, 0, strrpos($line, 
"/"));
 
 1809                                 $nr = substr_count($zdir, 
"/");
 
 1813                                         $nr = substr_count($zdir, 
"/");
 
 1814                                         $zdirs[$zdir] = $nr;                            
 
 1816                                         $zdir = substr($zdir, 0, strrpos($zdir, 
"/"));
 
 1823                 foreach($zdirs as $zdir => $nr)                         
 
 1849                 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
 
 1851                 $db = $this->client->getDB();
 
 1856                 foreach($setting_fields as $field)
 
 1858                         if( isset($session_settings[$field]) )
 
 1860                                 $query = 
"SELECT keyword FROM settings WHERE module = %s AND keyword = %s";
 
 1862                                                 array(
'text', 
'text'), array(
'common', $field));
 
 1867                                 if( count(
$row) > 0 )
 
 1872                                                         'value' => array(
'text', $session_settings[$field])
 
 1875                                                         'module' => array(
'text', 
'common'),
 
 1876                                                         'keyword' => array(
'text', $field)
 
 1885                                                         'module' => array(
'text', 
'common'),
 
 1886                                                         'keyword' => array(
'text', $field),
 
 1887                                                         'value' => array(
'text', $session_settings[$field])
 
 1896                 if($i < 4) $message = $this->lng->txt(
"session_settings_not_saved");
 
 1897                 else $message = $this->lng->txt(
"settings_saved");
 
 1909                 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
 
 1911                 $db = $this->client->getDB();
 
 1915                 $query = 
"SELECT * FROM settings WHERE module = %s " .
 
 1916                                 "AND ".$db->in(
'keyword', $setting_fields, 
false, 
'text');
 
 1920                 $session_settings = array();
 
 1923                         $session_settings[
$row[
'keyword']] = $row[
'value'];
 
 1926                 foreach( $setting_fields as $field )
 
 1928                         if( !isset($session_settings[$field]) )
 
 1934                                         case 'session_max_count':
 
 1939                                         case 'session_min_idle':
 
 1944                                         case 'session_max_idle':
 
 1949                                         case 'session_max_idle_after_first_request':
 
 1954                                         case 'session_allow_client_maintenance':
 
 1960                                 $session_settings[$field] = $value;
 
 1964                 return $session_settings;
 
 1973                 return parent::getFileName();
 
 1978                 if(!parent::valid())
 
 1982                 if($this->isFile() and substr(parent::getFileName(),-4) == 
'.xml')
 
 1986                 if($this->isFile() and substr(parent::getFileName(),-8) != 
'_inserts')
 
 1991                 return $this->
valid();