PHP Method User::activate, codiad Code Examples

This page contains top rated real world PHP examples of method User::activate from package codiad extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: index.controler.php Project: Woems/TerminGrul
0
 function run($template)
 {
     $dbuser = new User();
     if (isREQUEST("activate")) {
         if ($dbuser->activate(REQUEST("activate")) > 0) {
             $template->add("regsuccess", "Benuter aktiviert");
         } else {
             $template->add("regerror", "Fehler beim aktivieren des Users");
         }
     }
     if (isREQUEST("logout")) {
         $dbuser->logout();
     }
     if (isREQUEST("user") && isREQUEST("password")) {
         $usr = $dbuser->logout()->login(REQUEST("user"), REQUEST("password"));
         if (!$usr) {
             $template->add("error", "Login fehlgeschlagen");
         }
     }
     if (!($usr = $dbuser->logedin())) {
         $template->view("login");
         return;
     }
     $t = new Termin();
     $template->add("usr", $usr);
     // für die User Infos oben Rechts
     $template->add("byuser", $t->allbyuser($usr["id"]));
     $template->add("bymitglied", $t->allbymitglieder($usr["id"]));
     $template->view("main");
 }
Example #2
Show file File: UsersController.php Project: huang53798584/Authentication-System
0
 /**
  * Confirm the email address and activate the account
  *
  * @param string $confirmation_token
  * @return Response
  */
 public function activate($confirmation_token)
 {
     if (User::activate($confirmation_token)) {
         return Redirect::to('login')->with('alert-success', 'Account activated, you can now login');
     } else {
         return Redirect::to('/')->with('alert-warning', 'Account activation code not found');
     }
 }
Example #3
Show file File: activator.php Project: cybercog/exambuff
0
 public function activate($key)
 {
     if ($this->retrieve($key)) {
         $user = new User();
         if ($user->retrieve($this->get('email'))) {
             $user->activate();
             $this->delete();
             return true;
         }
     }
     return false;
 }
Example #4
Show file File: Company.php Project: rusty1909/Navigator
0
 public static function addEmployee($name, $emp_id, $address_1, $address_2, $landmark, $city, $state, $pincode, $phone, $fax, $email, $website, $description)
 {
     $defaultPassword = 'findgaddi';
     if (!empty($_SESSION['user']['company'])) {
         //$retCode = User::add($name, '', $emp_id, $defaultPassword, $phone, $phone, $email,  $address_1, $address_2, $landmark, $city, $state, $pincode, $_SESSION['user']['company']);
         if (User::add($name, '', $emp_id, $defaultPassword, $phone, $phone, $email, $address_1, $address_2, $landmark, $city, $state, $pincode, $_SESSION['user']['company'])) {
             User::activate(User::getIdByEmail($email));
             $mEmployee = new User(User::getIdByEmail($email));
             $mAddedBy = new User();
             $mEmployee->SetAddedby($mAddedBy->getId());
             Mailer::sendEmployeeAddedMessage($name, $emp_id, $email, $defaultPassword, $_SESSION['user']['company'], $mAddedBy->getFullname());
             return Timeline::addTimelineEvent("staff_addition", "", "", $mEmployee->getId(), $mAddedBy->getId(), 1);
             return true;
         }
         return false;
     } else {
         return false;
     }
 }
Example #5
Show file File: action.php Project: rustydev19/Navigator
0
        }
        break;
    case "logout":
        if ($mUser->logout()) {
            header('Location:login.php');
            exit;
        } else {
            header('Location:abc.php');
            exit;
        }
        break;
    case "activate":
        if (!isset($_GET['email']) || !isset($_GET['key'])) {
            echo "<script>window.location.href = '../user/login.php'</script>";
            break;
        }
        $email = $_GET['email'];
        $key = $_GET['key'];
        $id = User::getIdByEmail($email);
        $securityKey = Security::getSecurityKey($id);
        if ($key == $securityKey) {
            //die("match!!");
            if (User::activate($id)) {
                header('Location:activate.php?q=1');
            }
        } else {
            //die("sorry!!");
            echo "<script>window.location.href = '../user/login.php'</script>";
        }
        break;
}
Example #6
Show file File: index.php Project: ramant15/ektimo
0
function activate()
{
    global $error;
    $use_captcha = true;
    $arr_submit = array(array('uid', 'int', true, ''), array('hash', 'string', true, ''));
    $frm_submitted = validate_var($arr_submit);
    if (!$error) {
        $bln_success = User::activate($frm_submitted);
    }
}
Example #7
Show file File: users.php Project: csiber/CodeIgniter-Starter
0
 function activate($id, $code = false)
 {
     if ($code !== false) {
         $activation = User::activate($id, $code);
     } else {
         if ($this->sangar_auth->is_admin()) {
             $activation = User::activate($id);
         }
     }
     if ($activation) {
         //redirect them to the forgot password page
         $this->session->set_flashdata('message', array('type' => 'success', 'text' => lang('activate_successful')));
         if (!$this->sangar_auth->logged_in()) {
             redirect("login/", 'refresh');
         } else {
             redirect("/admin/users/", 'refresh');
         }
     } else {
         //redirect them to the forgot password page
         $this->session->set_flashdata('message', array('type' => 'warning', 'text' => lang('activate_unsuccessful')));
         redirect("login/", 'refresh');
     }
 }
Example #8
Show file File: users_test.php Project: csiber/CodeIgniter-Starter
0
 function test_activate_user()
 {
     $user = User::find_by_email($this->m_email_user);
     $validate = User::activate($user->id, $user->activation_code);
     $this->_assert_true($validate);
 }
Example #9
Show file File: activation.php Project: NimzyMaina/planner
0
<?php

require 'vendor/autoload.php';
$db = new Database();
$user = new User($db->conn);
if (isset($_GET['code'])) {
    if ($user->activate($_GET['code'])) {
        echo $url = getenv('SITE_URL') . "/login.php";
        exit;
        header("Location: {$url}");
    }
}
echo $url = getenv('SITE_URL') . "/register.php";
exit;
header("Location: {$url}");
Example #10
Show file File: Phphoto.php Project: BackupTheBerlios/phphoto-svn
0
 protected function _activate()
 {
     $uid = Utils::g('uid', 0);
     $r = Utils::g('r');
     $user = new User($uid);
     $user->activate($r, $this->url('login'));
     $this->setTemplateVar('login_url', $this->url('login'));
     $this->setTemplateVar('activation_ok', 1);
 }
Example #11
Show file File: user.php Project: bencochran/yeti
0
 public function actionActivate($name = null, $code = null)
 {
     $result = User::activate($name, $code);
     if ($result['status']) {
         Flash::set('success', $result['message']);
     } else {
         Flash::set('failure', $result['message']);
     }
     $this->redirect('/');
     die;
 }
Example #12
Show file File: index.php Project: BackupTheBerlios/phphoto-svn
0
function action_activate()
{
    global $smarty;
    $uid = Utils::g('uid', 0);
    $r = Utils::g('r');
    try {
        $user = new User($uid);
        $user->activate($r, url('login'));
        $smarty->assign('login_url', url('login'));
        $smarty->assign('activation_ok', 1);
    } catch (Exception $e) {
        $smarty->assign('error', 1);
        $smarty->assign('error_title', $e->getMessage());
        $smarty->assign('error_description', $e->getDescription());
    }
}
Example #13
Show file File: users.php Project: andersoonluan/PHP
0
        Session::Flash("usersPage", "danger", $ex->GetMessage(), true);
    }
}
if (Input::get("action") == "delete" && Input::get("userId") && $user->hasPermission("admin")) {
    try {
        $user->Delete(Input::get("userId"));
        Session::Flash("usersPage", "success", lang('USER_ACCOUNT_DELETED_SUCCESS'), true);
    } catch (Exception $ex) {
        Session::Flash("usersPage", "danger", $ex->GetMessage(), true);
    }
    Redirect::To("users.php");
}
if (Input::get("activate") && $user->hasPermission("admin") && Input::get("checkbox")) {
    try {
        foreach (Input::get("checkbox") as $checkbox) {
            $user->activate($checkbox);
        }
        Session::Flash("usersPage", "success", lang('USERS_ACCOUNT_ACTIVE_SUCCESS'), true);
    } catch (Exception $ex) {
        Session::Flash("usersPage", "danger", $ex->GetMessage(), true);
    }
}
if (Input::get("deactivate") && $user->hasPermission("admin") && Input::get("checkbox")) {
    try {
        foreach (Input::get("checkbox") as $checkbox) {
            $user->deactivate($checkbox);
        }
        Session::Flash("usersPage", "success", lang('USERS_ACCOUNT_DEACTIVE_SUCCESS'), true);
    } catch (Exception $ex) {
        Session::Flash("usersPage", "danger", $ex->GetMessage(), true);
    }
Example #14
Show file File: users.control.php Project: vdanelia/GeniXCMS
0
     $user_id = "";
 }
 switch ($action) {
     case 'activate':
         # code...
         if (!isset($_POST['token']) || !Token::isExist($_POST['token'])) {
             // VALIDATE ALL
             $alertred[] = TOKEN_NOT_EXIST;
         }
         if (isset($alertred)) {
             # code...
             $data['alertred'] = $alertred;
         } else {
             foreach ($user_id as $id) {
                 # code...
                 User::activate($id);
             }
         }
         if (isset($_POST['token'])) {
             Token::remove($_POST['token']);
         }
         break;
     case 'deactivate':
         # code...
         if (!isset($_POST['token']) || !Token::isExist($_POST['token'])) {
             // VALIDATE ALL
             $alertred[] = TOKEN_NOT_EXIST;
         }
         if (isset($alertred)) {
             # code...
             $data['alertred'] = $alertred;
Example #15
Show file File: Activate.php Project: deileo/DeckBuilder
0
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../../css/bootstrap/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/Stylesheet.css">
    <script src="../../Js/libs/jquery-2.1.4.min.js"></script>
    <script src="../../Js/libs/jquery-ui.min.js"></script>
    <link rel="stylesheet" href="../../css/jquery-ui.min.css">
    <script src="../../css/bootstrap/bootstrap.min.js"></script>
    <title>Home Page</title>
</head>
<?php 
require_once '../Includes.php';
if (isset($_GET['Ehash']) && !empty($_GET['Ehash'])) {
    $EmailHash = $_GET['Ehash'];
    $EmailHash = substr($EmailHash, 1, strlen($EmailHash) - 1);
    $User = new User();
    if ($User->activate($EmailHash)) {
        require_once '../../FrontEnd/Activation.php';
    } else {
        require_once '../../FrontEnd/FailedActivation.php';
    }
}
?>
<footer>
    <div class="navbar navbar-default navbar-static-bottom footer-style text-center">
        <div class="footer-text-style">2015 Deividas Leonavičius IFF-3/2</div>
    </div>
</footer>
</html>
Example #16
Show file File: Controller.class.php Project: ringe/RAS
0
 public function activate($activationkey = null)
 {
     if (!is_null($activationkey) and strlen($activationkey) != 14) {
         return false;
     }
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         //var_dump($_POST);
         Router::redirect("activate/" . $_POST['activationkey']);
         return true;
     } else {
         if (is_null($activationkey)) {
             new View('activation.tpl');
             return true;
         } else {
             try {
                 User::activate($activationkey);
                 Router::redirect("login");
                 return true;
             } catch (Exception $e) {
                 new View('activation.tpl', array('error' => $e->getMessage()));
                 return true;
             }
         }
     }
 }