Location: PHPKode > projects > Statiqz, website statistics > statiqz/ctrl/ActivateCtrl.class.php
<?php

require_once 'ctrl/BaseCtrl.class.php';

require_once 'xdbx/UsersXdbx.class.php';
require_once 'xdbx/VisitsXdbx.class.php';

class ActivateCtrl extends BaseCtrl {
    function ActivateCtrl() {

    }

    function process() {
        $ID   = $_GET['ID'];
        $code = $_GET['code'];

        $usersXdbx      = new UsersXdbx();
        $visitsXdbx     = new VisitsXdbx();

        if ($user = $usersXdbx->getUserByID($ID)) {
            if (($user[0]['code'] == $code) && ($user[0]['active'] == 0)) {
                $usersXdbx->activateUser($ID, $code);

                $visitsXdbx->addVisit($ID, 1, 2);

                $_SESSION['ID'] = $ID;

                redirect('index.php?ids=Clientcode');
            }
        }

        redirect('index.php?ids=Main');
    }
}

?>
Return current item: Statiqz, website statistics