예제 #1
0
파일: controller.php 프로젝트: hlag/svs
 public function getSite()
 {
     if (Request::getInstance()->getGetRequests('logout')) {
         Login::getInstance()->logout();
     }
     if (Login::getInstance()->isLoggedIn()) {
         $idt = Request::getInstance()->getGetRequests('idt');
         if (!$idt) {
             $idt = 'Liste';
         }
         $this->data['navi'] = $this->getNavi();
         $this->data['content'] = $this->getContent($idt);
         $this->data['logout'] = '<p class="navbar-text"><a class="navbar-link logout" href="index.php?logout=true" aria-label="Left Align"><span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> Logout</a></p>';
         $this->data['user'] = '';
     } else {
         $this->data['content'] = '';
         $this->data['user'] = '';
         $this->data['logout'] = '';
         $this->data['navi'] = '';
         if (Request::getInstance()->getPostRequests('anmelden') == 'anmelden') {
             $this->data['content'] .= '<p>Diese Emailadresse ist entweder nicht registriert oder noch nicht aktiviert.</p>';
         }
         $this->data['header'] = 'Anmelden';
         $this->data['content'] .= templateParser::getInstance()->parseTemplate(array(), 'Login/login_content_template.html');
     }
     return templateParser::getInstance()->parseTemplate($this->data, 'mainTemplate.html', false, false);
 }
예제 #2
0
 public function delete_contact($db, $table, $infos, $tab_log)
 {
     if (false === ($handler = $this->connectTo($db))) {
         return false;
     }
     $stmt = $handler->prepare("DELETE FROM " . $table . " \n\t\t\t\t\tWHERE id_contact = ?");
     $affect = $stmt->execute(array($infos['id_contact']));
     $log = $handler->prepare("INSERT INTO " . $tab_log . " (login, date, content) VALUES (?, ?, ?)");
     if (false === $affect) {
         $sentence = "The delete of the contact " . $infos['name'] . " " . $infos['surname'] . " of " . $infos['icao'] . " failed.";
         $log->execute(array(Login::getInstance()->getLog(), date("m-d-Y H:i:s"), $sentence));
         return false;
     } else {
         $sentence = "The update of the contact " . $infos['name'] . " " . $infos['surname'] . " of " . $infos['icao'] . " succeed.";
         $log->execute(array(Login::getInstance()->getLog(), date("m-d-Y H:i:s"), $sentence));
     }
     return true;
 }
예제 #3
0
if (Login::getInstance()->getSer_right() == "under-one" || Login::getInstance()->getSer_right() == "leader") {
    ?>
								<li><a tabindex="-1" href="./admin.php?packages" class="dropdown-submenu">Packages ADM</a></li>
							<?php 
}
?>
							<?php 
if (Login::getInstance()->getAw_right() != "0" && Login::getInstance()->getAw_right() != "1" && (Login::getInstance()->getDepartment() == "INF" || Login::getInstance()->getMagicStatus() == "ok" || Login::getInstance()->getAw_right() == "leader")) {
    ?>
								<li class="divider"></li>
								<li><a tabindex="-1" href="./inf-airman.php" class="dropdown-submenu">Infotel AIRMAN-web part</a></li>
							<?php 
}
?>
							<?php 
if (Login::getInstance()->getMagicStatus() == "ok") {
    ?>
								<li class="divider"></li>
								<li><a tabindex="-1" href="./magic_admin.php" class="dropdown-submenu">Magic ADM</a></li>
							<?php 
}
?>
						  </ul>
						</li>
					  </ul>
					</div>
				  </div>
				</div>
		    </div>
		</div>
	</div>
예제 #4
0
<?php

session_start();
include_once './lib/Manusing.php';
$manusing = Manusing::getInstance();
Classloader::getInstance()->loadPlugin("Login");
Login::getInstance();
$manusing->run();
예제 #5
0
파일: header.php 프로젝트: optium/marmiton
<?php

include "header_php.php";
if (!Login::getInstance()->isLogged()) {
    echo "You're not logged. Please, go to <a href='index.php'>the connexion page</a> and log you.";
    exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>SVIE21&2 Helper ~ SODA</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="css/css.css">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<script src="js/jquery-1.9.1.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" charset="utf-8" src="js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="js/ZeroClipboard.js"></script>
<script type="text/javascript" charset="utf-8" src="js/TableTools.js"></script>
<script type="text/javascript" charset="utf-8" src="js/dataTables.bootstrap.js"></script>

</head>
예제 #6
0
    }
    echo '{"rep":true,"msg":"personal info updated"}';
    exit;
}
if (isset($_GET['up_password'])) {
    $dal_perso = new DAL_Personal_admin();
    if (false === $dal_perso->update_password($_POST['new'], $_POST['id_user'])) {
        echo '{"rep":false,"msg":"Error while updating password"}';
        exit;
    }
    echo '{"rep":true,"msg":"password updated"}';
    exit;
}
if (isset($_GET['up_parameters'])) {
    $dal_perso = new DAL_Personal_admin();
    if (false === $dal_perso->update_parameters($_POST, $_POST['id_user'])) {
        echo '{"rep":false,"msg":"Error while updating parameters"}';
        exit;
    }
    echo '{"rep":true,"msg":"parameters updated"}';
    exit;
}
if (isset($_GET['request_access'])) {
    $dal_perso = new DAL_Personal_admin();
    if (false === $dal_perso->request_access($_GET['id_user'], $_GET['part'])) {
        echo '{"rep":false,"msg":"Error while updating parameters"}';
        exit;
    }
    echo '{"rep":true,"msg":"parameters updated"}';
    header("Location: ./../user.php?user=" . Login::getInstance()->getLogin());
}
예제 #7
0
<?php

include_once '../Classes/Config.inc.php';
/** Recebe o formulario */
$form = filter_input_array(INPUT_POST, FILTER_DEFAULT);
/** @var Login */
$login = Login::getInstance($form['login'], $form['senha']);
/** @var array */
$usuario = $login->consultar();
/** Verifica se o login é válido e cria uma nova sessão */
if (count($usuario) > 0) {
    session_start();
    $_SESSION['id'] = $usuario[0]['id'];
    $_SESSION['apelido'] = $usuario[0]['apelido'];
    $_SESSION['foto'] = $usuario[0]['foto'];
}
/** Retorna a quantidade de usuarios retornados na consulta */
echo count($usuario);
 /**
  * logout - Gets called when the user wants to be logged out of the
  * website. It deletes any cookies that were stored on the users
  * computer as a result of him wanting to be remembered, and also
  * unsets session variables and demotes his user level to guest.
  */
 function logout()
 {
     $login = Login::getInstance();
     /**
      * Delete cookies - the time must be in the past,
      * so just negate what you added when creating the
      * cookie.
      */
     if (isset($_COOKIE['cookname']) && isset($_COOKIE['cookid'])) {
         setcookie("cookname", "", time() - COOKIE_EXPIRE, COOKIE_PATH);
         setcookie("cookid", "", time() - COOKIE_EXPIRE, COOKIE_PATH);
     }
     /* Unset PHP session variables */
     unset($_SESSION['username']);
     unset($_SESSION['userid']);
     /* Reflect fact that user has logged out */
     $this->logged_in = false;
     /**
      * Remove from active users table and add to
      * active guests tables.
      */
     $login->removeActiveUser($this->username);
     $login->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time);
     /* Set user level to guest */
     $this->username = GUEST_NAME;
     $this->userlevel = GUEST_LEVEL;
 }
예제 #9
0
파일: user.php 프로젝트: optium/marmiton
						<?php 
    $dal_airman = new DAL_AirmanW();
    $log_airman = $dal_airman->get_my_log(Login::getInstance()->getLog());
    for ($i = 0; isset($log_airman[$i]); ++$i) {
        echo '<tr><td>' . $log_airman[$i]['date'] . '</td><td>' . $log_airman[$i]['content'] . '</td></tr>';
    }
    ?>
					</table>
				</div>
				<!-- Log AirFASE -->
				<div class="tab-pane fade" id="Log_airfase">
					<table class="table table-bordered table-striped">
						<tr><th>Date</th><th>Action</th><th>FAP</th><th>A/C info</th><th>Reg Number</th></tr>
						<?php 
    $dal_airfase = new DAL_Airfase();
    $log = $dal_airfase->get_my_log(Login::getInstance()->getLog());
    for ($i = 0; isset($log[$i]); ++$i) {
        $fap = $dal_airfase->getAFap($log[$i]['id_fap']);
        if (!empty($fap)) {
            echo '<tr><td>' . $log[$i]['date'] . '</td><td>' . $log[$i]['content'] . '</td><td>' . $fap['0']['icao'] . '</td><td>' . $fap['0']['ac_info'] . '</td><td>' . $fap['0']['reg_msn'] . '</td></tr>';
        } else {
            echo '<tr><td>' . $log[$i]['date'] . '</td><td>' . $log[$i]['content'] . '</td><td>ADMIN ACTION</td><td>N/A</td><td>N/A</td></tr>';
        }
    }
    ?>
					</table>
				</div>
				<!-- Log Deliveries -->
				<div class="tab-pane fade" id="Log_deliveries">
				deliveries
				</div>