Exemple #1
0
    exit;
}
$post_value = $_POST;
//Check logout request.
if (isset($post_value['value']) && $post_value['value'] == 'logout') {
    //Call logout function
    Authentication::logout();
} elseif (!empty($post_value['update'])) {
    //Call Update profile function
    Authentication::updateProfile($post_value);
} elseif (isset($post_value['newpassword']) && !empty($post_value['newpassword'])) {
    //Call change Password function
    Authentication::changePassword($post_value);
} elseif (isset($post_value['password']) && !empty($post_value['password'])) {
    //Call Set password function
    Authentication::setPassword($post_value);
} elseif (isset($post_value['value']) && $post_value['value'] == 'accountUnLink') {
    //Call Update profile function
    Authentication::unlinkAccount($post_value);
} elseif (isset($post_value['value']) && $post_value['value'] == 'accountLink') {
    //Call Update profile function
    Authentication::linkAccount($post_value);
}
$data = $_SESSION['userprofile'];
include_once 'includes/header.php';
?>
<!-- Add Profile page content-->
<div class="lr-profile-frame lr-input-style">
    <div class="lr-profile-header">
        <?php 
$image_url = isset($data->ImageUrl) && !empty($data->ImageUrl) ? $data->ImageUrl : "assets/images/user.png";
Exemple #2
0
     $e_username = true;
 }
 if (is_null($password)) {
     $error[] = "Password";
     $e_password = true;
 }
 if (is_null($email)) {
     $error[] = "Email";
     $e_email = true;
 }
 if (count($error) > 0) {
     $loadfile = "login/login_error.tpl";
 } else {
     $auth->setEmail($email);
     $auth->setUsername($username);
     $auth->setPassword($password);
     if ($auth->Authenticate()) {
         $loadfile = "login/login_successful.tpl";
         $redirect = "/#1";
     } else {
         $loadfile = "login/login_{$auth->getError()}.tpl";
         switch ($auth->getError()) {
             case "email":
                 $e_email = true;
                 break;
             case "username":
                 $e_username = true;
                 break;
             case "password":
                 $e_password = true;
                 break;