public function Load() { require_once dirname(__FILE__) . "/includes/utils-unset-var.inc.php"; if (!$this->isAjaxPage()) { unsetWspAdminVariables(); } parent::$PAGE_TITLE = __(CONNECT_PAGE_TITLE); $this->setUserRights(""); // Welcome message $this->render = new Table(); $this->render->setWidth("100%"); $connect_box = new RoundBox(RoundBox::STYLE_SECOND, "connect_box", 420, 150); $connect_box->setShadow(true); $connect_box->setValign(RoundBox::VALIGN_CENTER); $connect_table = new Table(); $connect_table->setWidth("100%")->setDefaultAlign(RowTable::ALIGN_LEFT); $admin_pic = new Picture("img/wsp-admin/admin_128.png", 128, 128); $this->auth_obj = new Authentication($this, "connect"); $this->auth_obj->setTableWidth(265); $connect_table->addRowColumns($admin_pic, $this->auth_obj); $connect_box->setContent($connect_table); $this->render->addRow("<br/><br/><br/><br/><br/>"); $this->obj_br_before = new Object(); $this->obj_br_before->setId("divBrBefore"); $this->render->addRow($this->obj_br_before); $this->mod_obj = new Object(); $this->mod_obj->setId("divConfigRecommandation")->setWidth(400); $this->render->addRow($this->mod_obj); $this->render->addRow(""); $this->render->addRow($connect_box, RowTable::ALIGN_CENTER, RowTable::VALIGN_CENTER); $this->render->addRow("<br/>"); }
public function Load() { require_once dirname(__FILE__) . "/includes/utils-unset-var.inc.php"; unsetWspAdminVariables(); $this->setUserRights(""); if (isset($_GET['referer'])) { $this->redirect(WSP_ADMIN_URL . "/connect.html?referer=" . urlencode($_GET['referer'])); } else { $this->redirect(WSP_ADMIN_URL . "/connect.html"); } }
// Update: .htaccess if (file_exists($base_dir . "/update.htaccess")) { $script_log_file->write("[" . date("Y-m-d H:i:s") . "] Start update .htaccess ...\n"); $htaccess_data = ""; if (file_exists($base_dir . "/.htaccess")) { $ht_file = new File($base_dir . "/.htaccess"); while (($line = $ht_file->read_line()) != false) { if (find($line, "# End zone for your URL rewriting") > 0) { break; } $htaccess_data .= $line; } $ht_file->close(); } else { $htaccess_data = "# Rule file .htaccess\r\nRewriteEngine on\r\nOptions +FollowSymLinks\r\nOptions -indexes\r\nAddDefaultCharset utf-8\r\n\r\n<IfModule mod_rewrite.c>\r\n\t# Redirecting www\r\n\t# Configure if you want redirect url http://example.com to http://www.example.com\r\n\tRewriteCond %{HTTP_HOST} ^mydomain\\.com\$ [NC]\r\n\tRewriteRule ^(.*)\$ http://www.mydomain.com/\$1 [R=301,L] \r\n\t\r\n\t# Alias: If you have configured an alias in the httpd.conf of Apache\r\n\t# Uncomment this line and configure the name of your alias.\r\n\t# If you are not sure don't change this line.\r\n\t#RewriteBase /myAliasName/\r\n\t\r\n\t# Zone to define your URL rewriting\r\n\t# Exemple 1: \r\n\t# Create an URL with 1 virtual folder (myfolder)\r\n\t# RewriteRule ^myfolder/(.+)\\.html\$ index.php?p=\$1&l=en&%{QUERY_STRING} [L]\r\n\t# In this case the first parameter is the language (ie: en, fr, de, ...) \r\n\t# RewriteRule ^([a-z]{2})/myfolder/(.+)\\.html\$ index.php?p=\$2&l=\$1&%{QUERY_STRING} [L] \r\n\t# \r\n\t# Exemple 2: \r\n\t# Create an URL with 2 virtuals folders (myfolder and myfolder2)\r\n\t# RewriteRule ^myfolder/myfolder2/(.+)\\.html\$ index.php?p=\$1&l=en&%{QUERY_STRING} [L] \r\n\t# RewriteRule ^([a-z]{2})/myfolder/myfolder2/(.+)\\.html\$ index.php?p=\$2&l=\$1&%{QUERY_STRING} [L] \r\n\t# \r\n\t# Exemple 3: \r\n\t# Create an URL with 1 variable virtual folder\r\n\t# The 2nd parameter exclude the folders ajax (use by the ajax pages of the framework) and wsp-admin (admin part of WSP)\r\n\t# RewriteRule ^([a-z]{2})/((?!(ajax|wsp\\-admin)).+)/(.+)\\.html\$ index.php?p=my_page&l=\$1¶m1=\$2¶m2=\$3&%{QUERY_STRING} [L]\r\n\t# \r\n\t# Warning: Create your rules only if the framework can't support your special URL => virtual folder (the framework manages the real folders)\r\n\t#\r\n\t\n"; } $htaccess_data = $htaccess_data . file_get_contents($base_dir . "/update.htaccess"); $ht_file = new File($base_dir . "/.htaccess", false, true); $ht_file->write($htaccess_data); $ht_file->close(); unlink($base_dir . "/update.htaccess"); $script_log_file->write("[" . date("Y-m-d H:i:s") . "] End update .htaccess\n"); } $script_log_file->write("[" . date("Y-m-d H:i:s") . "] Start unset variables ...\n"); require_once dirname(__FILE__) . "/../includes/utils-unset-var.inc.php"; unsetWspAdminVariables(); $script_log_file->write("[" . date("Y-m-d H:i:s") . "] End unset variables\n"); $script_log_file->close(); } else { $bool = false; }