Esempio n. 1
0
 function logOut()
 {
     if ($this->usertype == session::USER_DOCTOR || $this->usertype == session::USER_REGULAR) {
         OnlineUser::destroy(['id' => $this->username]);
     }
     unset($_SESSION['username']);
     unset($_SESSION['usertype']);
     unset($this->username);
     unset($this->usertype);
     $this->loggedin = false;
 }
Esempio n. 2
0
 public static function get_online_users($condition, $parameters)
 {
     $users = array();
     $result = self::$querier->select("SELECT \n\t\ts.user_id, s.timestamp, s.location_script, s.location_title,\n\t\tm.display_name, m.level, m.groups,\n\t\tf.user_avatar\n\t\tFROM " . DB_TABLE_SESSIONS . " s\n\t\tLEFT JOIN " . DB_TABLE_MEMBER . " m ON m.user_id = s.user_id \n\t\tLEFT JOIN " . DB_TABLE_MEMBER_EXTENDED_FIELDS . " f ON f.user_id = s.user_id " . $condition, $parameters);
     while ($row = $result->fetch()) {
         $user = new OnlineUser();
         $user->set_id($row['user_id']);
         $user->set_display_name($row['display_name']);
         $user->set_level($row['user_id'] != User::VISITOR_LEVEL ? $row['level'] : User::VISITOR_LEVEL);
         $user->set_groups(explode('|', $row['groups']));
         $user->set_last_update(new Date($row['timestamp'], Timezone::SERVER_TIMEZONE));
         $user->set_location_script($row['location_script']);
         $user->set_location_title(stripslashes($row['location_title']));
         $user->set_avatar($row['user_avatar']);
         $users[] = $user;
     }
     $result->dispose();
     return $users;
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = OnlineUser::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Esempio n. 4
0
function online_users($type)
{
    $r = OnlineUser::join('autism_users', 'autism_users.id', '=', 'autism_online.id')->where('autism_users.type', '=', $type)->get();
    return $r;
}
Esempio n. 5
0
     if ($fax != "" && ($result = validate($fax, "phonenumber", 45)) !== true) {
         $errorText .= "<LI>Your fax number is {$result}";
     }
 }
 if (($result = validate($password, "password", 45, 6)) !== true) {
     $errorText .= "<LI>Your password is {$result}";
 }
 if ($_POST["readTerms"] != "on") {
     $errorText .= "<LI>Please read the terms and then tick the box to proceed";
 }
 if ($errorText == "") {
     $query = $db->Query("SELECT * FROM onlineuser WHERE email='" . $db->Escape($email) . "' LIMIT 1");
     if ($db->Rows() > 0) {
         $errorText .= "<LI>The email address you have entered is taken";
     } else {
         $user = new OnlineUser($email, $first_name, $last_name, $password, $address1, $address2, $address3, $postcode, $telephone, $fax, '', 'temp');
         if (isSuperUser(false) && $status != "") {
             $user->user_status = $status;
         }
         $userId = $user->Save();
         $user = $user->Get($userId);
         $created = strtotime($user->dt_created);
         $mail = new Emailer();
         $mail->setTo($email);
         $mail->setFrom($configuration["fromEmail"]);
         $mail->setSubject("Fastfoodjobsuk Registration");
         $url = "http://www.fastfoodjobsuk.co.uk/register_activate.php?email={$email}&code={$created}";
         $mail->bodyAdd("Dear {$first_name} {$last_name}");
         $mail->bodyAdd("");
         $mail->bodyAdd("Thank you for registering with Fast Food Jobs but as we take your privacy seriously, we just wanted to check you did register with our site.");
         $mail->bodyAdd("In order to gain access to all of the web site functionality please click on here: {$url}");
Esempio n. 6
0
                                        <div class="space space-4"></div>
                                        <?php 
echo CHtml::link('<i class="icon-edit bigger-110"></i> Edit Profile', array('update', 'id' => $model->id), array('class' => 'btn btn-small btn-block btn-primary'));
?>
                                        <?php 
echo CHtml::link('<i class="icon-lock bigger-110"></i> Change Password', array('edit', 'id' => $model->id), array('class' => 'btn btn-small btn-block btn-warning'));
?>
                                    </div><!-- /span -->
                                    <div class="span9">
                                        <h4 class="blue">
                                            <span class="middle"><?php 
echo $model->name;
?>
</span>
                                            <?php 
echo '<span style="margin-left:20px;"></span>' . OnlineUser::get_online_status($model->id);
?>
                                        </h4>
                                        <div class="profile-user-info">
                                            <div class="profile-info-row">
                                                <div class="profile-info-name"> Username </div>

                                                <div class="profile-info-value">
                                                    <span><?php 
echo $model->username;
?>
</span>
                                                </div>
                                            </div>                                        
                                            <div class="profile-info-row">
                                                <div class="profile-info-name"> Email </div>
Esempio n. 7
0
 public static function get_online_status($id)
 {
     $title = OnlineUser::model()->findByAttributes(array('userId' => $id));
     if (!empty($title->userId)) {
         return '<span class="label label-purple arrowed-in-right"> <i class="icon-circle"></i> Online</span>';
     } else {
         return '<span class="label label-lg label-grey arrowed-in"> <i class="icon-circle"></i> Offline</span>';
     }
 }