PHP User::CheckLogin Examples

PHP User::CheckLogin - 11 examples found. These are the top rated real world PHP examples of User::CheckLogin extracted from open source projects. You can rate examples to help us improve the quality of examples.
 public function checkLogin($username, $password)
 {
     $user = User::CheckLogin($username, $password);
     if ($user != false) {
         $_SESSION["loggedIn"] = serialize($user);
         header('Location: index.php');
         return true;
     } else {
         return false;
     }
 }
 /**
  * Metodo CheckUserSorteio
  *
  * @access public
  * @param integer $user_id
  * @param integer $sorteio_id
  * @return integer
  */
 public function CheckUserSorteio($user_id, $sorteio_id)
 {
     $session = new Session();
     $session->StartSession();
     $user = new User();
     if (!$user->CheckLogin($session->data)) {
         echo "<script>document.location.href='" . DIR_DOCS . "logout/'</script>";
     }
     $querys = new Querys();
     $sql = "SELECT \n                  *\n                FROM  \n                  " . $this->tabela . "\n                WHERE \n                  par_sorteios_id = '" . (int) $sorteio_id . "' AND\n                  par_accounts_id = '" . (int) $user_id . "'";
     $query = $querys->query($sql);
     return $query->num_rows;
 }
Example #3
0
 public function actionRegUser()
 {
     $login = $_POST['loginReg'];
     $password = $_POST['passwordReg'];
     if (User::CheckLogin($login)) {
         echo "<h3> Используйте другой логин, этот уже существует!</h3>";
     } else {
         if (User::addUser($login, $password)) {
             echo "<h3>Вы успешно зарегистрировались!</h3>";
         }
     }
     require_once ROOT . '/views/Avtorisation.php';
     return true;
 }
 /**
  * Metodo CheckGanhador
  *
  * @access public
  * @param integer $sorteio_id
  * @return integer
  */
 public function CheckGanhador($sorteio_id)
 {
     $session = new Session();
     $session->StartSession();
     $user = new User();
     if (!$user->CheckLogin($session->data)) {
         echo "<script>document.location.href='" . DIR_DOCS . "logout/'</script>";
     }
     $querys = new Querys();
     $sql = "SELECT \n                  g.*,\n                  a.act_account_nome,\n                  a.act_accounts_id,\n                  a.act_account_sobrenome\n                FROM  \n                  " . $this->tabela . " g\n                LEFT JOIN\n                  " . $this->tabela_accounts . " a ON (a.act_accounts_id = g.gan_accounts_id)\n                WHERE \n                 g.gan_sorteios_id = '" . (int) $sorteio_id . "'";
     $query = $querys->query($sql);
     if ($query->num_rows > 0) {
         return $query->row;
     } else {
         return $query->num_rows;
     }
 }
Example #5
0
function PhotoUpload($val)
{
    User::CheckLogin();
    $url = $val["url"];
    $title = $val["title"];
    $img = './Assets/piaf_' . time() . ".jpg";
    if (!copy($url, $img)) {
        exit("Mums neizdodas nokopēt failu no weblapas!");
    }
    $link = DBConnect::GetConnection();
    $sql = "INSERT INTO gallery (title, src) VALUES(?, ?)";
    $query = $link->prepare($sql);
    $query->bind_param("ss", $title, $img);
    if ($query->execute()) {
        echo "success";
    } else {
        echo $query->error;
    }
    $query->close();
    $link->close();
}
Example #6
0
<?php

include "../system.php";
session_start();
User::CheckLogin();
?>

<div class="moduleTemplate" data-win-control="WinJS.Binding.Template">
    <div class="module">
        <!--<div class="moduleIcon" data-win-bind="style.backgroundImage: icon"></div>-->
        <div class="moduleContent">
            <div class="moduleInformation">
                <div class="moduleName" data-win-bind="textContent: friendly_name"></div>
                <div class="moduleUserVisible" title="Lietotāji redz šo lapu" data-win-bind="dataset.guestVisible: user_visible">Lietotāji</div>
                <div class="moduleGuestVisible" title="Viesi redz šo lapu" data-win-bind="dataset.userVisible: guest_visible">Viesi</div>
            </div>
            <div class="moduleUrl" data-win-bind="textContent: url"></div>
        </div>
        <div class="moduleManage" style="float: right">
            <div class="moduleEdit" data-win-bind="className: editable">
                <button class="win-button win-button-primary" onclick="loadContent('Manage/edit.php?name=' + this.dataset.moduleName + '&system=' + this.dataset.moduleSystem)" data-win-bind="dataset.moduleSystem: system; dataset.moduleName: name">Rediģēt</button>
            </div>
            <div class="moduleRemove" data-win-bind="className: removable">
                <button class="win-button win-button-primary" onclick="RemovePage(this.dataset.moduleName)" data-win-bind="dataset.moduleName: name">Dzēst</button>
            </div>
        </div>
    </div>
</div>

<div id="moduleList" data-win-control="WinJS.UI.Pivot" data-win-options="{ selectedIndex: <?php 
echo isset($_GET["index"]) ? $_GET["index"] : 0;
include 'Sorteios.php';
include 'Participantes.php';
include 'Ganhadores.php';
include 'Checkout.php';
include 'Vendas.php';
include 'Cadastros.php';
include 'ProdutosInfo.php';
$querys = new Querys();
// Inicia Classe Querys
$session = new Session();
// Inicia Classe Session
$session->StartSession();
// Inicia SESSION
$user = new User();
// Inicia Classe User
$sorteios = new Sorteios();
$participantes = new Participantes();
$ganhadores = new Ganhadores();
$produtos_info = new ProdutosInfo();
$vendas = new Vendas();
if (!isset($session->data['user']['user_login']) and !isset($session->data['user']['user_cpf'])) {
    $session->Destroy('user');
} else {
    $user->CheckLogin($session->data);
    if ($user->isLoggedUser()) {
        if ($user->isConfirmed() == '0') {
            $S_NotConfirmed = true;
        }
        $S_UserLogin = $user->isLoggedUser();
    }
}
 /**
  * Metodo CheckCreditExists
  *
  * @access public
  * @param int $act_accounts_id
  * @return boolean
  */
 public function CheckCreditExists($act_accounts_id)
 {
     $session = new Session();
     $session->StartSession();
     $user = new User();
     $user->CheckLogin($session->data);
     $querys = new Querys();
     $sql = "SELECT \n                  *\n                FROM  \n                  " . $this->tabela_credit . "\n                WHERE \n                  act_accounts_id = '" . $act_accounts_id . "'";
     $query = $querys->query($sql);
     if ($query->num_rows == 0) {
         return false;
     } else {
         return true;
     }
 }
 /**
  * Metodo ConfirmSorteio
  *
  * @access public
  * @param array $data
  * @return array
  */
 public function ConfirmSorteio($registro_id)
 {
     $session = new Session();
     $session->StartSession();
     $user = new User();
     if (!$user->CheckLogin($session->data)) {
         echo "<script>document.location.href='" . DIR_DOCS . "logout/'</script>";
     }
     $querys = new Querys();
     $sql = "UPDATE \n                  " . $this->tabela . " \n                SET \n                  sor_sorteio_status = '1'\n                WHERE \n                  sor_sorteios_id = '" . (int) $registro_id . "'";
     $query = $querys->query($sql);
     return $query;
 }
 /**
  * Metodo getCanceladas
  *
  * @access public
  * @param int $act_accounts_id
  * @return array
  */
 public function getCanceladas($act_accounts_id)
 {
     $session = new Session();
     $session->StartSession();
     $user = new User();
     if (!$user->CheckLogin($session->data)) {
         echo "<script>document.location.href='" . DIR_DOCS . "logout/'</script>";
     }
     $querys = new Querys();
     $sql = "SELECT \n                  COUNT(*) as count\n                FROM  \n                  " . $this->tabela . "\n                WHERE \n                  vnd_accounts_id = '" . $act_accounts_id . "' AND\n                  (vnd_status = '6' OR \n                  vnd_status = '7' OR \n                  vnd_status = '8')";
     $query = $querys->query($sql);
     return $query->row['count'];
 }
Example #11
0
<?php

/********************
 * Auteurs : Jérôme Chételat / Philippe Ku
 * Ecole/Classe : CFPT Informatique
 * Date : 02.12.15
 * Programme : Local.ch
 * Fichier : login.php
 * Version : 1.0
 *******************/
session_start();
require_once './user.php';
$e_login = false;
if (isset($_REQUEST['connexion'])) {
    $u = new User();
    if ($u->CheckLogin($_REQUEST['username'], $_REQUEST['password'])) {
        $u->selectUser($_REQUEST['username']);
        $_SESSION['username'] = $u->username;
        header("Location: index.php");
    } else {
        $e_login = true;
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>Local.ch - Login</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="css/localchstyle.css"/>