Example #1
0
function login()
{
    $username = $_POST['username'];
    $password = $_POST['password'];
    unset($_POST['username']);
    unset($_POST['password']);
    $login = new LoginManager();
    $login->login($username, $password);
}
 static function register()
 {
     if (!LoginManager::isRegistered()) {
         $login = sqlite_escape_string(LoginManager::getLogin());
         $email = sqlite_escape_string(LoginManager::getEmail());
         DatabaseManager::setQuery("INSERT INTO users VALUES(\n                '{$login}',\n                '',\n                '{$email}',\n                0\n                );");
     }
 }
Example #3
0
 function Run()
 {
     //Load config
     $config = new Config();
     $config->Load();
     $displayManager = new DisplayManager();
     //Create Login Manager
     $loginManager = new LoginManager();
     $loginManager->Load();
     $loginFail = false;
     if ($loginManager->WantLogin()) {
         $loginFail = !$loginManager->TryLogin();
         if (!$loginFail) {
             header('location: index.php');
         }
     }
     if ($loginManager->WantLogout()) {
         $loginManager->Logout();
     }
     if (isset($_GET['want']) and $_GET['want'] == 'logo') {
         $logo = new Logo();
         $logo->Generate();
         return;
     } elseif (isset($_GET['want']) and $_GET['want'] == 'source') {
         $displayManager->DisplaySource();
     } else {
         if ($loginManager->IsLogged()) {
             $imageManager = new ImageManager();
             $images = $imageManager->GetImages();
             $displayManager->DisplayImagesPage($images);
         } else {
             $displayManager->DisplayLoginPage($loginFail);
         }
     }
 }
 public function sendPasswordHint()
 {
     $oUser = UserQuery::create()->findPk($this->iUserId);
     if ($oUser) {
         LoginManager::sendResetMail($oUser, true, LinkUtil::link(array(), 'LoginManager'));
         return $this->iUserId;
     }
     return false;
 }
Example #5
0
 /**
  * Retrieve all details of the current and removed rateplans on the given user's subscription. The Subscription summary that gets returned will contain a list of Active plans, and removed plans.
  * @param $accountName Name of the target account
  * @return Subscription details
  */
 public static function loginAttempt($username, $partnerLogin)
 {
     session_start();
     session_regenerate_id();
     $_SESSION = array();
     $loginValid = LoginManager::validateUsername($username);
     if ($loginValid) {
         $loginResult = LoginManager::loginSuccess($username, $partnerLogin);
     } else {
         $loginResult = false;
     }
     return $loginResult;
 }
Example #6
0
 function generateContent()
 {
     $content = '
     <h1>' . _('User list') . '</h1>
     ';
     if (LoginManager::isLogged() && LoginManager::isAdministrator()) {
         $content .= $this->displayContent();
     } else {
         $content .= "<p>You must be logged as administrator to access to user list.</p>";
         $content .= '<p><a href="' . RessourceManager::getInnerUrl('special/login/login_form') . '">' . _('Go to login page') . '</a></p>';
     }
     return $content;
 }
Example #7
0
 function execute()
 {
     $this->content = '
     <h1>' . _('Logout') . '</h1>';
     if (LoginManager::isLogged()) {
         $this->content .= '
             <p>' . sprintf(_('Logout from \'%s\' success.'), LoginManager::getLogin()) . '</p>';
     } else {
         $this->content .= '
             <p>' . _('You are not logged.') . '</p>';
     }
     $this->content .= '
         <p><a href="' . RessourceManager::getInnerUrl('index') . '">' . _('Return to index') . '</a></p>';
     LoginManager::logout();
 }
 public function resetRequest($sUserNameOrPassword, $bForce)
 {
     if ($sUserNameOrPassword === '') {
         throw new LocalizedException('flash.login.username_or_email_required');
     }
     $oUser = UserQuery::create()->filterByUsername($sUserNameOrPassword)->findOne();
     $bShowUserName = false;
     if ($oUser === null) {
         $oUser = UserQuery::create()->filterByEmail($sUserNameOrPassword)->findOne();
         $bShowUserName = true;
     }
     if ($oUser) {
         LoginManager::sendResetMail($oUser, $bShowUserName, null, $bForce);
     }
 }
 function displayContent()
 {
     $content = '';
     $content .= '
         <h2>' . _('Current propositions') . '</h2>';
     $user = LoginManager::getLogin();
     $results = DatabaseManager::getQuery("SELECT * FROM proposed_exercises WHERE (state='waiting' OR state='processing')");
     while ($result = $results->fetchArray()) {
         $content .= '<div class="subblock" ><ul>';
         $content .= '<li>' . _('Name: ') . $result['name'] . '</li>';
         $content .= '<li>' . _('Description: ') . $result['description'] . '</li>';
         $content .= '<li>' . _('Links: ') . $result['links'] . '</li>';
         $content .= '<li>' . _('Proposer: ') . $result['user'] . '</li>';
         $state = $result['state'];
         $stateStr = _('Unknown state');
         if ($state == 'waiting') {
             $stateStr = _('Waiting for processing');
         } elseif ($state == 'processing') {
             $stateStr = _('Processing');
         } elseif ($state == 'accepted') {
             $stateStr = _('Accepted');
         }
         $content .= '<li>' . _('State: ') . $stateStr . '</li>';
         $content .= '</ul></div>';
     }
     $content .= '
         <h2>' . _('Old propositions') . '</h2>';
     $results = DatabaseManager::getQuery("SELECT * FROM proposed_exercises WHERE  not (state='waiting' OR state='processing')");
     while ($result = $results->fetchArray()) {
         $content .= '<div class="subblock" ><ul>';
         $content .= '<li>' . _('Name: ') . $result['name'] . '</li>';
         $content .= '<li>' . _('Description: ') . $result['description'] . '</li>';
         $content .= '<li>' . _('Links: ') . $result['links'] . '</li>';
         $content .= '<li>' . _('Proposer: ') . $result['user'] . '</li>';
         $state = $result['state'];
         $stateStr = _('Unknown state');
         if ($state == 'waiting') {
             $stateStr = _('Waiting for processing');
         } elseif ($state == 'processing') {
             $stateStr = _('Processing');
         } elseif ($state == 'accepted') {
             $stateStr = _('Accepted');
         }
         $content .= '<li>' . _('State: ') . $stateStr . '</li>';
         $content .= '</ul></div>';
     }
     return $content;
 }
Example #10
0
 function generateContent()
 {
     $content = '
     <h1>' . _('Add a new exercise') . '</h1>
     ';
     if (LoginManager::isLogged() && LoginManager::isAdministrator()) {
         if ($_SESSION['form_enabled']) {
             $content .= $this->displayForm();
         } else {
             $content .= '
         <p>' . $this->message . '<p/>';
             $content .= '<p><a href="' . RessourceManager::getInnerUrl('exercises/index') . '">' . _('Return to exercises index.') . '</a></p>';
         }
     } else {
         $content .= "<p>You must be logged as administrator to add an exercise.</p>";
         $content .= '<p><a href="' . RessourceManager::getInnerUrl('special/login/login_form') . '">' . _('Go to login page') . '</a></p>';
     }
     return $content;
 }
 function execute()
 {
     require_once 'openid.php';
     $openid = new Dope_OpenID($_GET['openid_identity']);
     $validate_result = $openid->validateWithServer();
     if ($validate_result === TRUE) {
         $userinfo = $openid->filterUserInfo($_GET);
         LoginManager::login($_GET['openid_identity'], $userinfo['email'], $userinfo['fullname']);
     } else {
         if ($openid->isError() === TRUE) {
             LoginManager::logout();
             $error = $openid->GetError();
             $this->error = _("Login failed.") . '<br />';
             $this->error .= "Error code: " . $error['code'] . "<br/>";
             $this->error .= "Error description: " . $error['description'] . "<br/>";
         } else {
             LoginManager::logout();
             // Signature Verification Failed
             $this->error = _("Login failed.");
         }
     }
     /*
             $openid = new SimpleOpenID;
             $openid->SetIdentity($_GET['openid_identity']);
     
             $openid_validation_result = $openid->ValidateWithServer();
             if ($openid_validation_result == true){         // OK HERE KEY IS VALID
                 print_r($openid->fields['required']);
                 LoginManager::login($_GET['openid_identity']);
     
             }else if($openid->IsError() == true){            // ON THE WAY, WE GOT SOME ERROR
                 LoginManager::logout();
                 $error = $openid->GetError();
                 $this->error = _("Login failed.").'<br />';
                 $this->error .= "Error code: " . $error['code'] . "<br/>";
                 $this->error .= "Error description: " . $error['description'] . "<br/>";
             }else{
                 LoginManager::logout();// Signature Verification Failed
                 $this->error = _("Login failed.");
             }
     */
 }
Example #12
0
 public function display(Template $oTemplate, $bIsPreview = false)
 {
     if (Manager::isPost()) {
         ArrayUtil::trimStringsInArray($_POST);
     }
     //1st step: user clicked on the recovery link
     //	• Display email field
     if (isset($_REQUEST['password_forgotten'])) {
         $this->sAction = 'password_forgotten';
     }
     //2nd step: user has entered an email address
     //	• Send the email with the recovery link (and generate the hint)
     //	• Add confirmation message to flash
     if (isset($_POST['password_reset_user_name'])) {
         $this->sAction = LoginManager::processPasswordReset(LinkUtil::link($this->oPage->getFullPathArray(), 'FrontendManager'));
     }
     //3rd step: user has clicked on the reset link in the e-mail
     //	• Validate the hint
     //	• Display a form for entering a new password (form also contains hidden fields for email and hint)
     //	• Add the referrer to the session (again)
     if (isset($_REQUEST['recover_username'])) {
         $this->sAction = LoginManager::passwordReset();
     }
     //4th step: user has submitted the new password
     //	• Validate the hint (again)
     //	• Validate password constraints
     //	• Set the new password (if valid)
     //	• Log in (if valid)
     //	• Redirect to the referrer (if valid)
     if (isset($_POST['new_password'])) {
         $this->sAction = LoginManager::loginNewPassword(LinkUtil::link($this->oPage->getFullPathArray()));
     }
     if (isset($_POST[LoginManager::USER_NAME])) {
         LoginManager::login(null, null, LinkUtil::link($this->oPage->getFullPathArray()));
     }
     parent::display($oTemplate, $bIsPreview);
 }
Example #13
0
<?php

/**
 * Created by PhpStorm.
 * User: bryan
 * Date: 11/8/15
 * Time: 10:37 AM
 */
include_once "Connection.php";
include_once "LoginManager.php";
if (isset($_POST['submit'])) {
    $movieId = filter_input(INPUT_POST, 'movie');
    $rating = filter_input(INPUT_POST, 'rating');
    $content = filter_input(INPUT_POST, 'content');
    $return = filter_input(INPUT_POST, 'return');
    $login = new LoginManager($return);
    $userId = $login->getLoggedInUserId();
    $connection = new Connection();
    $connection->createReview($userId, $movieId, $rating, $content);
    if (!$return) {
        $return = "../index.php";
    }
    $movie = $connection->getMoviesById([$movieId])[0];
    $title = $movie->getTitle();
    if (strpos($return, "?") !== FALSE) {
        $notificationGets = "&addreview={$title}";
    } else {
        $notificationGets = "?addreview={$title}";
    }
    header("Location: {$return}{$notificationGets}");
} else {
Example #14
0
<?php

require_once dirname(__FILE__) . "/_graphSetup.php";
LoginManager::enforceAnonymous();
PageContent::header("Login");
if ($_POST['login'] && ($user = LoginManager::verifyLogin($_POST['username'], $_POST['userpass']))) {
    LoginManager::setUser($user);
    header("Location: /graphs");
}
echo "\n<form method='post'>\n\t<table>\n\t\t<tr>\n\t\t\t<td>Username:</td>\n\t\t\t<td><input type='text' name='username' /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Password:</td>\n\t\t\t<td><input type='password' name='userpass' /></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan='2' align='right'>\n\t\t\t\t<input type='submit' name='login' value='Login' />\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n</form>\n";
Example #15
0
<!DOCTYPE html>

<?php 
include_once "php/UserView.php";
include_once "php/LoginManager.php";
if (isset($_GET['id'])) {
    $id = filter_input(INPUT_GET, 'id');
    $view = new UserView($id);
    $login = new LoginManager("profile.php?id={$id}");
    $return = "../profile.php?id={$id}";
} else {
    header("Location: index.php");
    exit;
}
?>

<html>
    <head>
        <meta charset="UTF-8">
        <title><?php 
echo $view->getUsername() . " on tbmd.com";
?>
</title>
        <link rel="stylesheet" href="style/main.css">
        <link rel="stylesheet" href="style/overlay.css">
        <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/notify/0.4.0/notify.min.js"></script>
        <script src="script/notifications.js"></script>
        <script src="script/overlay.js"></script>
        <script src="script/search.js"></script>
  <div id="ontologyArea">
	<h2>Ontology surfing</h2>




	<?php 
//HERE WE GENERATE A loginArea if the user is not logged in, otherwise a "Welcome screen and logout area"
$LoginManager = new LoginManager();
if (!$LoginManager->isLoggedin()) {
    ?>
		<div id="loginArea">
			<hr/>
			<p>Login here to interact with ontology</p>
			<table>
				<tr><td>User </td> <td><input type="text" id="usrfield" name="usr" /></td> </tr>
				<tr><td>Password </td> <td><input type="text" id="pwdfield" name="psw" /></td> </tr>
				<tr><td><input type="submit" value="Login" onclick="doLogin();" /></td><td><input type="submit" value="Register" onclick="doRegister();"/></td></tr>
			</table>
			<hr/>
		</div>
	<?php 
} else {
    ?>
		<div id="loginArea">
			<hr/>
			<p>Welcome in Tagonto</p>
			<p><strong><a onclick="doLogout();"/>Logout</a></strong></p>
			<hr/>
		</div>
		
Example #17
0
	若必須取出 請存入某個file裡面 然後在需要時讀出
*/
require_once "AttackDetector/g103056001/G103056001AccountInfo.php";
require_once "ConfigManager.php";
require_once "GlobalFunc.php";
require_once "LoginManager.php";
require_once "AttackDetector.php";
//used in AttackDetector
require_once "Planet.php";
require_once "Defender.php";
//used in Defender
require_once "FleetCommander.php";
date_default_timezone_set('Asia/Taipei');
//error_reporting(E_DEPRECATED); 連error都沒有
error_reporting(-1);
$Config = ConfigManager::declareConfigValue();
//結束時會取得一次overview page
$LoginManager = new LoginManager();
$LoginManager->start();
//會取得一次overview page
$PLANETS = Planet::getPlanets();
echo "\nThreaten Count: " . $Config['ThreatenCount'] . "\n";
if ($PLANETS) {
    echo "AttackDetector is Constructed, " . sizeof($PLANETS) . " planet(s) is protected.\n";
    for ($i = 0; $i < sizeof($PLANETS); $i++) {
        echo "Planet(" . $PLANETS[$i]->num . "): " . $PLANETS[$i]->name . "[" . $PLANETS[$i]->coord[0] . ":" . $PLANETS[$i]->coord[1] . ":" . $PLANETS[$i]->coord[2] . "] is detected.\n";
        $_defender = new Defender($PLANETS[$i]->coord, $Config['SHIELD'], $PLANETS[$i]->href, $PLANETS[$i]);
        $PLANETS[$i]->defender = $_defender;
        $PLANETS[$i]->defender->start();
    }
}
<?php

$id = $pluginManager->getCommand(0);
$password = $pluginManager->getCommand(1);
if (!empty($_POST['noteContent']) and !empty($id)) {
    $content = $_POST['noteContent'];
    $change = array("text" => array("value" => $content));
    if (!empty($_POST['password'])) {
        $change['password']['value'] = LoginManager::getSaltedPassword($loginManager->getUsername(), $_POST['password']);
    }
    $pluginManager->databaseManager->setValue($change, array("id" => array("operator" => "=", "value" => $id, "type" => "i")));
    $pluginManager->redirect($pluginManager);
}
$value = $pluginManager->databaseManager->getValues(array("id" => array("operator" => "=", "value" => $id)), 1);
if (!empty($value['password']) && !empty($password)) {
    if ($value['password'] != $password) {
        $pluginManager->redirect($pluginManager, 'password', $id);
    }
} else {
    if (!empty($value['password']) && empty($password)) {
        $pluginManager->redirect($pluginManager, 'password', $id);
    }
}
$jUI->add(new JUI\Heading($value['name']));
$textarea = new JUI\Input("noteContent");
$textarea->setPreset(JUI\Input::MULTILINE);
$textarea->setWidth('100%');
$textarea->setHeight(200);
$textarea->setValue($value['text']);
$jUI->add($textarea);
$warning = new JUI\Text("Wenn das Kennwortfeld leer gelassen wird, so wird das bisherige Kennwort benutzt.");
<?php

if (!empty($_POST['notePassword']) && !empty($_POST['noteId'])) {
    $pluginManager->redirect($pluginManager, 'notes', $_POST['noteId'] . '/' . LoginManager::getSaltedPassword($loginManager->getUsername(), $_POST['notePassword']));
}
$noteId = $pluginManager->getCommand(0);
$jUI->add(new JUI\Heading("Anmeldung für Notiz"));
$idInput = new JUI\Input("noteId");
$idInput->setValue($noteId);
$idInput->setVisible(JUI\View::GONE);
$jUI->add($idInput);
$password = new JUI\Input("notePassword");
$password->setLabel("Kennwort");
$password->setPreset(JUI\Input::PASSWORD);
$jUI->add($password);
$jUI->nline(2);
$submit = new JUI\Button("Speichern");
$submit->setClick(new JUI\Click(JUI\Click::submit));
$jUI->add($submit);
Example #20
0
 public function asBlockView()
 {
     $movie = $this->getMovie();
     $title = $movie->getTitle();
     $movieId = $movie->getId();
     $link = "movie.php?id={$movieId}";
     $a = "<a href='" . $link . "' target='_blank'>{$title}</a>";
     $header = "<h3>{$a}</h3>";
     $stars = "";
     $login = new LoginManager("../error.php");
     $userId = $this->user->getId();
     if ($login->isLoggedIn() && $userId == $login->getLoggedInUserId()) {
         $addReview = "<input class='edit_review' id='edit_" . $this->id . "' type='button' value='Edit'>";
     } else {
         $addReview = "";
     }
     for ($i = 0; $i < $this->rating; $i++) {
         $stars .= "<img src='./images/star-on.svg'>";
     }
     for ($i = $this->rating; $i < 10; $i++) {
         $stars .= "<img src='./images/star-off.svg'>";
     }
     $userLink = "profile.php?id=" . $this->getUser()->getId();
     $userA = "<a href='" . $userLink . "' target='_blank'>{$this->user}</a>";
     $submission = "<p><strong>Submitted By: </strong>{$userA}</p>";
     $date = "<p><strong>Submitted On: </strong>{$this->submitDate}</p>";
     $ratingValue = "<span class='rating'>{$this->rating}</span>";
     $rating = "<p>{$stars}</p>";
     $review = "<p><strong>Review: </strong><span class='review_content'>{$this->reviewContent}</span></p>";
     $id = "'review_" . $this->id . "'";
     return "<div id={$id} class='review_block'>{$addReview}{$header}{$submission}{$date}{$rating}{$review}{$ratingValue}</div>";
 }
Example #21
0
<?php

require_once dirname(__FILE__) . "/../autoloader.php";
session_start();
$script = $_SERVER['REQUEST_URI'];
if (!LoginManager::getUser() && $script != "/processLogin.php") {
    $script = "/login.php";
}
if ($script == '/') {
    $script = '/home.php';
}
$pageContent = PageContent::getPage($script);
$jsInclude = PageContent::getJs($script);
$cssInclude = PageContent::getCss($script);
$title = PageContent::header();
echo "\n<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'\n\t'http://www.w3.org/TR/html4/loose.dtd'>\n<html>\n<head>\n\t<title>SPEED POOL</title>\n\t<meta name='viewport' content='width=device-width, initial-scale=1'>\n\t<link rel='stylesheet' href='http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css' />\n\t<link rel='stylesheet' href='/css/simpledialog.css' />\n\t<link rel='stylesheet' href='/css/style.css' />\n\t<script type='text/javascript' src='http://code.jquery.com/jquery-1.7.1.min.js'></script>\n\t<script type='text/javascript' src='/js/mobileinit.js'></script>\n\t<script type='text/javascript' src='http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js'></script>\n\t<script type='text/javascript' src='/js/simpledialog2.js'></script>\n\t<script type='text/javascript' src='/js/utility.js'></script>\n</head>\n<body>\n\n<div data-role='page' id='page'>\n\t{$cssInclude}\n\t{$jsInclude}\n\t<div data-role='header'>\n\t\t<h1>{$title}</h1>\n\t</div>\n\t<div data-role='content'>\n\t\t{$pageContent}\n\t</div>\n</div>\n\n</body>\n</html>\n";
Example #22
0
<?php

require_once "classes/LoginManager.php";
session_start();
$login = new LoginManager();
$login->checkLogin();
exit;
 function isSame($pPassword1, $pUsername, $pPassword2)
 {
     if ($pPassword1 == LoginManager::getSaltedPassword($pUsername, $pPassword2)) {
         return true;
     }
     return false;
 }
Example #24
0
<!DOCTYPE html>

<?php 
include_once "php/View.php";
include_once 'php/LoginManager.php';
$view = new View();
$login = new LoginManager("error.php");
?>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Error</title>
    <link rel="stylesheet" href="style/main.css">
    <link rel="stylesheet" href="style/overlay.css">
    <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/notify/0.4.0/notify.min.js"></script>
    <script src="script/notifications.js"></script>
    <script src="script/signup.js"></script>
    <script src="script/overlay.js"></script>
</head>
<body>
    
    <!-- Hidden Page Content -->
    <?php 
//<editor-fold defaultstate="collapsed" desc="Hidden Forms for Javascript Popups">
?>
    <div class="overlay" id="add_user">
        <div>
            <input class="exit" id="add_user_close" type="button" value="x">
Example #25
0
<?php

require_once "classes/LoginManager.php";
$login = new LoginManager();
$login->logout();
Example #26
0
<?php

$user = LoginManager::enforceLogin();
PageContent::addStatic("timer");
$options = "\n\t<option value='-1' data-placeholder='true'>Select Player</option>\n\t<option value='0'>Create New</option>\n";
$players = "<div class='hidden'>";
foreach (Player::getPlayers($user->uid()) as $player) {
    /** @var $player Player */
    $players .= "\n\t\t<div class='player'>\n\t\t\t<span class='id'>" . $player->pid() . "</span>\n\t\t\t<span class='name'>" . $player->name() . "</span>\n\t\t</div>\n\t";
}
$players .= "</div>";
echo "\n\t<select id='playerSelect'>\n\t\t{$options}\n\t</select>\n\t{$players}\n\t<div id='play'>\n\t\t<div id='timerContainer'>\n\t\t\t<div id='timer'>00:00.000</div>\n\t\t</div>\n\t\t<fieldset class='ui-grid-a'>\n\t\t\t<div class='ui-block-a'><button data-mini='true' id='timerReset'>Reset</button></div>\n\t\t\t<div class='ui-block-b'><button data-mini='true' id='timerPenalty'>Penalty</button></div>\n\t\t</fieldset>\n\t\t<button data-mini='true' id='timerToggle'>Start</button>\n\t\t<table class='hidden' id='penaltyContainer'>\n\t\t\t<tr>\n\t\t\t\t<th>When</th>\n\t\t\t\t<th>Amount</th>\n\t\t\t</tr>\n\t\t</table>\n\t</div>\n";
Example #27
0
function subscribeWithCurrentCart()
{
    global $messages;
    $userEmail = $_SESSION['userEmail'];
    $pmId = $_REQUEST['pmId'];
    $subRes = SubscriptionManager::subscribeWithCart($userEmail, $pmId, $_SESSION['cart']);
    if ($subRes == 'DUPLICATE_EMAIL') {
        addErrors(null, "This email address is already in use. Please choose another and re-submit.");
        return;
    }
    if ($subRes == 'INVALID_PMID') {
        addErrors(null, "There was an error processing this transaction. Please try again.");
        return;
    }
    $partnerLogin = false;
    $loginRes = LoginManager::loginAttempt($userEmail, $partnerLogin);
    $messages = $subRes;
}
Example #28
0
<html>

<?php 
require_once "LoginManager.php";
require_once "AccessiManager.php";
require_once "ConfigManager.php";
global $username, $password, $message;
$ConfigManager = new ConfigManager();
$versione = $ConfigManager->getVersione();
$ambiente = $ConfigManager->getAmbiente();
$utenza = "n.d.";
$stagione = "n.d.";
$LoginManager = new LoginManager();
$AccessiManager = new AccessiManager();
if (isset($_POST['username']) && isset($_POST['password'])) {
    $auth = $LoginManager->autenticate($_POST['username'], $_POST['password']);
    if (mysql_num_rows($auth) != 0) {
        session_start();
        $_SESSION['login'] = '******';
        $_SESSION['username'] = $_POST['username'];
        $message = null;
        AccessiManager::inserisci($_POST['username'], $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']), $_SERVER['REQUEST_URI'], 'LOGIN->DONE');
        $LoginManager::gestioneCertificatiMedici();
        //header("Location: AtletaView.php");
        header("Location: view/selezioneStagione.php");
    } else {
        AccessiManager::inserisci($_POST['username'], $_SERVER['REMOTE_ADDR'], gethostbyaddr($_SERVER['REMOTE_ADDR']), $_SERVER['REQUEST_URI'], 'LOGIN->FAILED');
        $message = 'Inserire utenza/password validi!';
    }
} else {
}
Example #29
0
require_once "EscapeFilter.php";
require_once "LoginManager.php";
require_once "AttackDetector.php";
require_once "RecourseManager.php";
//used in AttackDetector
require_once "Planet.php";
require_once "Defender.php";
//used in Defender
require_once "FleetCommander.php";
date_default_timezone_set('Asia/Taipei');
//error_reporting(E_DEPRECATED); 連error都沒有
//error_reporting(E_ERROR);
//error_reporting(-1);
$Config = ConfigManager::declareConfigValue();
//結束時會取得一次overview page
$loginManager = new LoginManager();
echo "\nThreaten Count: " . $Config['ThreatenCount'] . "\n";
//會取得一次overview page
$PLANETS = Planet::getPlanets();
if ($PLANETS) {
    $loginManager->start();
    $ResourceManager = new RecourseManager($PLANETS);
    $ResourceManager->start();
    if (isset($PLANETS)) {
        echo "AttackDetector is Constructed, " . sizeof($PLANETS) . " planet(s) is protected.\n";
    } else {
        echo "Failed to get planet list, login and get planet list again.\n";
        $loginManager->newSessionGetOverview();
        $PLANETS = Planet::getPlanets();
    }
    for ($i = 0; $i < sizeof($PLANETS); $i++) {
Example #30
0
<?php

LoginManager::enforceAnonymous();
PageContent::header("Login");
echo "\n<form method='post' action='/processLogin.php'>\n\t<div data-role='fieldcontain'>\n\t\t<label for='username'>Username:</label>\n\t\t<input type='text' name='username' id='username' />\n\t</div>\n\n\t<div data-role='fieldcontain'>\n\t\t<label for='userpass'>Password:</label>\n\t\t<input type='password' name='userpass' id='userpass' />\n\t</div>\n\n\t<input type='submit' name='login' value='Login' />\n</form>\n";