コード例 #1
0
 private function checkFormResponse()
 {
     // If the password/laguage aren't given
     if (!isset($_POST["password"]) || !isset($_POST["language"])) {
         // Displaying the install page
         \Paladin\Paladin::getPageLoader()->displayPage("\\SUpdateServer\\Pages", "Install", array());
     } else {
         // Seting the user logged
         $_SESSION["logged"] = true;
         // Saving the config
         file_put_contents(\SUpdateServer\SessionManager::getSessionManager()->getPasswordLocation(), sha1($_POST["password"]));
         \SUpdateServer\LangLoader\LangLoader::getLangLoader()->setCurrentLang($_POST["language"]);
         // Redirecting the user
         header("Location: " . \Paladin\Paladin::getRootFolder());
     }
 }
コード例 #2
0
ファイル: Login.php プロジェクト: BlackScarx/S-Update-Server
 private function checkFormResponse()
 {
     // If the password isn't given
     if (!isset($_POST["password"])) {
         // Displaying the login page
         \Paladin\Paladin::getPageLoader()->displayPage("\\SUpdateServer\\Pages", "Login", array("badPassword" => false, "serverActivated" => \SUpdateServer\ServerState::isEnabled()));
     } else {
         if (\SUpdateServer\SessionManager::getSessionManager()->checkPassword($_POST["password"])) {
             // Seting the user logged
             $_SESSION["logged"] = true;
             // Going to the index page
             header("Location: " . \Paladin\Paladin::getRootFolder());
         } else {
             // Displaying the login page, with a bad password message
             \Paladin\Paladin::getPageLoader()->displayPage("\\SUpdateServer\\Pages", "Login", array("badPassword" => true, "serverActivated" => \SUpdateServer\ServerState::isEnabled()));
         }
     }
 }
コード例 #3
0
 public function checkFormResponse()
 {
     // If the form variable exist
     if (isset($_POST["form"])) {
         // If the form is the password form
         if ($_POST["form"] == "passwordForm") {
             // If the password variable exist
             if (isset($_POST["password"])) {
                 // Writing it
                 file_put_contents(\SUpdateServer\SessionManager::getSessionManager()->getPasswordLocation(), sha1($_POST["password"]));
                 // Then redirecting the user
                 header("Location: Index");
             } else {
                 // Displaying the settings page
                 \Paladin\Paladin::getPageLoader()->displayPage("\\SUpdateServer\\Pages", "Settings", array());
             }
         } else {
             if ($_POST["form"] == "langForm") {
                 // If the language variable exist
                 if (isset($_POST["language"])) {
                     // Setting it
                     \SUpdateServer\LangLoader\LangLoader::getLangLoader()->setCurrentLang($_POST["language"]);
                     // Then redirecting the user
                     header("Location: Index");
                 } else {
                     // Displaying the settings page
                     \Paladin\Paladin::getPageLoader()->displayPage("\\SUpdateServer\\Pages", "Settings", array());
                 }
             } else {
                 // Displaying the settings page
                 \Paladin\Paladin::getPageLoader()->displayPage("\\SUpdateServer\\Pages", "Settings", array());
             }
         }
     } else {
         // Displaying the settings page
         \Paladin\Paladin::getPageLoader()->displayPage("\\SUpdateServer\\Pages", "Settings", array());
     }
 }
コード例 #4
0
 public function load()
 {
     echo \SUpdateServer\SessionManager::getSessionManager()->addAuthorizedPage("GetIgnoreList");
 }