Пример #1
0
 public static function get_profile($u, $privacy = true, $badges = true, $social_networks = true, $friends = true, $exp = true, $aditional_info = true, $gamertags = true)
 {
     Phalanx::loadClasses('Privacy', 'Badges', 'Friendship', 'SocialNetwork', 'Posts', 'GamerTags');
     $m = Model::Factory('user u');
     $m->where("login='******'");
     $user = $m->get();
     if (!$user) {
         return false;
     }
     # Em alguns casos, não é necessário utilizarmos todos os dados do usuário
     if ($privacy) {
         $user->privacy = Privacy::from_user($user->id);
     }
     if ($badges) {
         $user->badges = Badges::from_user($user->id);
     }
     if ($social_networks) {
         $user->social_networks = SocialNetwork::from_user($user->id);
     }
     if ($friends) {
         $user->friends = Friendship::from_user($user->id, 12);
     }
     if ($exp) {
         $user->experience = self::experience($user->id);
     }
     if ($aditional_info) {
         $user->aditional_info = self::other_data($user->id);
     }
     if ($gamertags) {
         $user->gamertags = GamerTags::from_user($user->id);
     }
     return $user;
 }
Пример #2
0
 public function __construct()
 {
     $privacies = Privacy::where('is_deleted', 0)->get();
     View::share('privacies', $privacies);
     if (Session::has('user') && User::find(Session::get('user')['id'])) {
         $notifications = $this->getNotification();
         View::share('noti_data', $notifications);
     }
 }
Пример #3
0
 public function getUserPrivacy($id)
 {
     $u_privacy = Privacy::where('userid', '=', $id)->get();
     //var_dump($u_privacy);exit;
     if (isset($u_privacy)) {
         return $u_privacy;
     } else {
         return null;
     }
 }
Пример #4
0
 private function getViewProfileDatas($user_id)
 {
     $privacy = Privacy::where('name', "Công khai")->get()->first();
     $datas = array();
     if (FEUsersHelper::isCurrentUser($user_id)) {
         $entries = Entry::where('user_id', $user_id)->orderBy('updated_at', 'DESC')->paginate($this->entries_per_page);
         $left_albums = Album::where('user_id', $user_id)->orderBy('updated_at', 'DESC')->get();
     } else {
         $entries = Entry::where('user_id', $user_id)->where('privacy', $privacy->id)->orderBy('updated_at', 'DESC')->paginate($this->entries_per_page);
         $left_albums = Album::where('user_id', $user_id)->where('privacy', 1)->orderBy('updated_at', 'DESC')->get();
     }
     return array("entries" => $entries, "left_albums" => $left_albums);
 }
Пример #5
0
<?php

// Include required files
include_once dirname(dirname(__FILE__)) . '/config/bootstrap.php';
App::LoadClass('User');
App::LoadClass('Privacy');
// Establish page variables, objects, arrays, etc
View::InitView('opt_out');
Plugin::Trigger('opt_out.start');
View::$vars->logged_in = User::LoginCheck();
if (View::$vars->logged_in) {
    View::$vars->user = new User(View::$vars->logged_in);
}
### Verify user actually unsubscribed
if (isset($_GET['email'])) {
    $data = array('email' => $_GET['email']);
    $id = User::Exist($data);
    if ($id) {
        $privacy = Privacy::LoadByUser($id);
        $data = array('new_video' => 'no', 'new_message' => 'no', 'video_comment' => 'no');
        Plugin::Trigger('opt_out.opt_out');
        $privacy->Update($data);
    } else {
        App::Throw404();
    }
} else {
    App::Throw404();
}
// Output Page
Plugin::Trigger('opt_out.before_render');
View::Render('opt_out.tpl');
Пример #6
0
<?php

// Include required files
include_once dirname(dirname(dirname(__FILE__))) . '/config/bootstrap.php';
App::LoadClass('User');
App::LoadClass('Privacy');
// Establish page variables, objects, arrays, etc
View::InitView('privacy_settings');
Plugin::Trigger('privacy_settings.start');
Functions::RedirectIf(View::$vars->logged_in = User::LoginCheck(), HOST . '/login/');
View::$vars->user = new User(View::$vars->logged_in);
View::$vars->privacy = Privacy::LoadByUser(View::$vars->user->user_id);
View::$vars->data = array();
View::$vars->errors = array();
View::$vars->message = null;
/**************************
 * Handle Form if submitted
 *************************/
if (isset($_POST['submitted'])) {
    // Validate Video Comments
    if (isset($_POST['video_comment']) && in_array($_POST['video_comment'], array('0', '1'))) {
        View::$vars->data['video_comment'] = $_POST['video_comment'];
    } else {
        View::$vars->errors['video_comment'] = TRUE;
    }
    // Validate Private Message
    if (isset($_POST['new_message']) && in_array($_POST['new_message'], array('0', '1'))) {
        View::$vars->data['new_message'] = $_POST['new_message'];
    } else {
        View::$vars->errors['new_message'] = TRUE;
    }
Пример #7
0
 /**
  * [privacyUserSave save method for user privacy
  * @param  [integer] $id [user id]
  * @return [none]     [redirect to user privacy page]
  */
 public function privacyUserSave($id)
 {
     $data = Input::all();
     //var_dump($data);exit;
     Privacy::where('userid', '=', $id)->delete();
     $privacy = new Privacy();
     $privacy->userid = $id;
     $privacy->fname = isset($data['fname']) ? true : false;
     $privacy->lname = isset($data['lname']) ? true : false;
     $privacy->email = isset($data['email']) ? true : false;
     $privacy->telno = isset($data['telno']) ? true : false;
     $privacy->agency = isset($data['agency']) ? true : false;
     $privacy->ministry = isset($data['ministry']) ? true : false;
     $privacy->role = isset($data['role']) ? true : false;
     $privacy->save();
     return Redirect::to('/privacy/' . $id)->with('success', 'Your user privacy saved.');
 }
Пример #8
0
 /**
  * Delete a record
  * @param integer $id ID of record to be deleted
  * @return void Record is deleted from database
  */
 static function Delete($id)
 {
     App::LoadClass('Privacy');
     App::LoadClass('Avatar');
     App::LoadClass('Video');
     App::LoadClass('Subscription');
     App::LoadClass('Rating');
     App::LoadClass('Flag');
     App::LoadClass('Favorite');
     App::LoadClass('Comment');
     App::LoadClass('Post');
     App::LoadClass('Message');
     $db = Database::GetInstance();
     $user = new self($id);
     Plugin::Trigger('user.delete');
     // Delete Avatar
     if (!empty($user->avatar)) {
         Avatar::Delete($user->avatar);
     }
     // Delete Privacy Record
     $privacy_id = Privacy::Exist(array('user_id' => $id));
     Privacy::Delete($privacy_id);
     // Delete Comments
     $query = "SELECT comment_id FROM " . DB_PREFIX . "comments WHERE user_id = {$id}";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Comment::Delete($row->comment_id);
     }
     // Delete Ratings
     $query = "SELECT rating_id FROM " . DB_PREFIX . "ratings WHERE user_id = {$id}";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Rating::Delete($row->rating_id);
     }
     // Delete Favorites
     $query = "SELECT fav_id FROM " . DB_PREFIX . "favorites WHERE user_id = {$id}";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Favorite::Delete($row->fav_id);
     }
     // Delete Flags
     $query = "SELECT flag_id FROM " . DB_PREFIX . "flags WHERE id = {$id} AND type = 'user'";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Flag::Delete($row->flag_id);
     }
     // Delete Subscriptions
     $query = "SELECT sub_id FROM " . DB_PREFIX . "subscriptions WHERE user_id = {$id} OR member = {$id}";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Subscription::Delete($row->sub_id);
     }
     // Delete Posts
     $query = "SELECT post_id FROM " . DB_PREFIX . "posts WHERE user_id = {$id}";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Post::Delete($row->post_id);
     }
     // Delete Messages
     $query = "SELECT message_id FROM " . DB_PREFIX . "messages WHERE user_id = {$id} OR recipient = {$id}";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Message::Delete($row->message_id);
     }
     // Delete Videos
     $query = "SELECT video_id FROM " . DB_PREFIX . "videos WHERE user_id = {$id}";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Video::Delete($row->video_id);
     }
     // Delete Privacy
     $query = "SELECT privacy_id FROM " . DB_PREFIX . "privacy WHERE user_id = {$id}";
     $result = $db->Query($query);
     while ($row = $db->FetchObj($result)) {
         Privacy::Delete($row->privacy_id);
     }
     // Delete User
     $query = "DELETE FROM " . DB_PREFIX . self::$table . " WHERE " . self::$id_name . " = {$id}";
     $db->Query($query);
 }
Пример #9
0
 public function privacy()
 {
     $privacy = Privacy::by('volontario', $this);
     if (!$privacy) {
         $privacy = new Privacy();
         $privacy->volontario = $this;
         $privacy->contatti = PRIVACY_COMITATO;
         $privacy->mess = PRIVACY_COMITATO;
         $privacy->curriculum = PRIVACY_PRIVATA;
         $privacy->incarichi = PRIVACY_PRIVATA;
     }
     return $privacy;
 }
Пример #10
0
 /**
  * [userPeerPrivacy show informatioin of user by user's privacy in modal]
  * @param  [integer] $id [user id]
  * @return [type]     [description]
  */
 public function userPeerPrivacy($id)
 {
     $user_info = new Usernhc();
     $rs_userinfo = $user_info->getUsernhcById($id);
     //var_dump($rs_userinfo);
     $privacy = new Privacy();
     $user_privacy = $privacy->getUserPrivacy($id);
     return View::make('peer.ajax_userprivacy')->with('user_info', $rs_userinfo[0])->with('user_privacy', $user_privacy[0]);
 }
Пример #11
0
		$u->supporter += floor($txn->amount);
		$u->save();
		header('Location: support.php?e=4');
		exit;
	}
	else {
		$t->err = "There was an error processing the transaction, please contact an admin in the forum with the following transaction ID: $txn->id";
	}

}
else {
	$txn->time       = time();
	$txn->amount     = $paymentAmount;
	$txn->userId     = Privacy::getId();
	if (!$filtered['support-userId']) {
		$txn->forId  = Privacy::getId();
	}
	else {
		$txn->forId      = $filtered['support-userId'];
	}
	$txn->isAlliance = 0;
	$t->uid = $filteredG['uid'];
	if ($filtered['paypal-submit_x']) {
	
		$txnId = $txn->create();
		$pp = new Paypal();
	
		if(!$pp->step1And2($txn)) {
			//Redirecting to APIError.php to display errors. 
			$error = 3;
		}
Пример #12
0
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

***/

require_once('scripts/vsys.php');
require_once('scripts/SpyLog.php');

new Privacy(PRIVACY_PRIVATE);

if (!Privacy::isIn())  {
	header('Location: index.php');
	exit;
}


$filters = array(
	'uid' => FILTER_VALIDATE_INT | FILTER_SANITIZE_NUMBER_INT,
	'spy' => FILTER_SANITIZE_STRING,
);

$filteredG = filter_input_array(INPUT_GET, $filters);
$filtered  = filter_input_array(INPUT_POST, $filters);

if ($filteredG['uid'] and $filteredG['spy']) {
	$filtered['uid'] = $filteredG['uid'];
Пример #13
0
function me($id = null) {
	if ($id) {
		return intval($id) == Privacy::getId();
	}
	return Privacy::getId();
}
Пример #14
0
    if (!empty($_POST['message']) && !ctype_space($_POST['message'])) {
        $message['message'] = htmlspecialchars($_POST['message']);
        View::$vars->msg = $message['message'];
    } else {
        View::$vars->errors['message'] = Language::GetText('error_message');
    }
    // Create message if no errors were found
    if (empty(View::$vars->errors)) {
        $message['user_id'] = View::$vars->user->user_id;
        Plugin::Trigger('message_send.before_send_message');
        Message::Create($message);
        View::$vars->to = NULL;
        View::$vars->subject = NULL;
        View::$vars->msg = NULL;
        // Send recipient email notification if opted-in
        $privacy = Privacy::LoadByUser($recipient->user_id);
        if ($privacy->OptCheck('new_message')) {
            $replacements = array('host' => HOST, 'sitename' => $config->sitename, 'sender' => View::$vars->user->username, 'email' => $recipient->email);
            $mail = new Mail();
            $mail->LoadTemplate('new_message', $replacements);
            $mail->Send($recipient->email);
        }
        View::$vars->message = Language::GetText('success_message_sent');
        View::$vars->message_type = 'success';
        Plugin::Trigger('message_send.send_message');
    } else {
        View::$vars->message = Language::GetText('errors_below');
        View::$vars->message .= '<br /><br /> - ' . implode('<br /> - ', View::$vars->errors);
        View::$vars->message_type = 'error';
    }
}
Пример #15
0
 /**
  * Make a video visible to the public and notify subscribers of new video
  * @global object $config Site configuration settings
  * @param string $action Step in the approval proccess to perform. Allowed values: create|activate|approve
  * @return void Video is activated, subscribers are notified, and admin
  * alerted. If approval is required video is marked as pending and placed in queue
  */
 public function Approve($action)
 {
     App::LoadClass('User');
     App::LoadClass('Privacy');
     App::LoadClass('Mail');
     global $config;
     $send_alert = false;
     Plugin::Trigger('video.before_approve');
     // 1) Admin created video in Admin Panel
     // 2) User created video
     // 3) Video is being approved by admin for first time
     if (in_array($action, array('create', 'activate')) || $action == 'approve' && $this->released == 0) {
         // User uploaded video but needs admin approval
         if ($action == 'activate' && Settings::Get('auto_approve_videos') == '0') {
             // Send Admin Approval Alert
             $send_alert = true;
             $subject = 'New Video Awaiting Approval';
             $body = 'A new video has been uploaded and is awaiting admin approval.';
             // Set Pending
             $this->Update(array('status' => 'pending approval'));
             Plugin::Trigger('video.approve_required');
         } else {
             // Send Admin Alert
             if (in_array($action, array('create', 'activate')) && Settings::Get('alerts_videos') == '1') {
                 $send_alert = true;
                 $subject = 'New Video Uploaded';
                 $body = 'A new video has been uploaded.';
             }
             // Activate & Release
             $this->Update(array('status' => 'approved', 'released' => 1));
             // Send subscribers notification if opted-in
             $query = "SELECT user_id FROM " . DB_PREFIX . "subscriptions WHERE member = {$this->user_id}";
             $result = $this->db->Query($query);
             while ($opt = $this->db->FetchObj($result)) {
                 $subscriber = new User($opt->user_id);
                 $privacy = Privacy::LoadByUser($opt->user_id);
                 if ($privacy->OptCheck('new_video')) {
                     $replacements = array('host' => HOST, 'sitename' => $config->sitename, 'email' => $subscriber->email, 'member' => $this->username, 'title' => $this->title, 'video_id' => $this->video_id, 'slug' => $this->slug);
                     $mail = new Mail();
                     $mail->LoadTemplate('new_video', $replacements);
                     $mail->Send($subscriber->email);
                     Plugin::Trigger('video.notify_subscribers');
                 }
             }
             Plugin::Trigger('video.release');
         }
         // Video is being re-approved
     } else {
         if ($action == 'approve' && $this->released != 0) {
             // Approve Video
             $this->Update(array('status' => 'approved'));
             Plugin::Trigger('video.reapprove');
         }
     }
     // Send admin alert
     if ($send_alert) {
         $body .= "\n\n=======================================================\n";
         $body .= "Title: {$this->title}\n";
         $body .= "URL: {$this->url}\n";
         $body .= "=======================================================";
         App::Alert($subject, $body);
     }
     Plugin::Trigger('video.approve');
 }
Пример #16
0
/***

    World War II MMORPG
    Copyright (C) 2009-2010 Richard Eames

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

***/


	session_start();
	require_once('env/env.php');
	require_once('scripts/Privacy.php');
	Privacy::logout();

	header("Location: index.php"); 
	exit;
?>
Пример #17
0
 public static function getId($name = "Công khai")
 {
     return Privacy::where("name", $name)->get()->first()->id;
 }
Пример #18
0
 /**
  * Make a comment visible to the public and notify user of new comment
  * @global object $config Site configuration settings
  * @param string $action Step in the approval proccess to perform. Allowed values: create|activate|approve
  * @return void Comment is activated, user is notified, and admin alerted.
  * If approval is required comment is marked pending and placed in queue
  */
 public function Approve($action)
 {
     App::LoadClass('User');
     App::LoadClass('Video');
     App::LoadClass('Privacy');
     App::LoadClass('Mail');
     global $config;
     $send_alert = false;
     $video = new Video($this->video_id);
     Plugin::Trigger('comment.before_approve');
     // 1) Admin posted comment in Admin Panel
     // 2) Comment is posted by user
     // 3) Comment is being approved by admin for first time
     if (in_array($action, array('create', 'activate')) || $action == 'approve' && $this->released == 0) {
         // Comment is being posted by user, but approval is required
         if ($action == 'activate' && Settings::Get('auto_approve_comments') == '0') {
             // Send Admin Approval Alert
             $send_alert = true;
             $subject = 'New Comment Awaiting Approval';
             $body = 'A new comment has been posted and is awaiting admin approval.';
             // Set Pending
             $this->Update(array('status' => 'pending'));
             Plugin::Trigger('comment.approve_required');
         } else {
             // Send Admin Alert
             if (in_array($action, array('create', 'activate')) && Settings::Get('alerts_comments') == '1') {
                 $send_alert = true;
                 $subject = 'New Comment Posted';
                 $body = 'A new comment has been posted.';
             }
             // Activate & Release
             $this->Update(array('status' => 'approved', 'released' => 1));
             // Send video owner new comment notifition, if opted-in
             $privacy = Privacy::LoadByUser($video->user_id);
             if ($privacy->OptCheck('video_comment')) {
                 $user = new User($video->user_id);
                 $replacements = array('host' => HOST, 'sitename' => $config->sitename, 'email' => $user->email, 'title' => $video->title);
                 $mail = new Mail();
                 $mail->LoadTemplate('video_comment', $replacements);
                 $mail->Send($user->email);
                 Plugin::Trigger('comment.notify_member');
             }
             Plugin::Trigger('comment.release');
         }
         // Comment is being re-approved
     } else {
         if ($action == 'approve' && $this->released != 0) {
             // Activate Comment
             $this->Update(array('status' => 'approved'));
             Plugin::Trigger('comment.reapprove');
         }
     }
     // Send admin alert
     if ($send_alert) {
         $body .= "\n\n=======================================================\n";
         $body .= "Author: {$this->name}\n";
         $body .= "Video URL: {$video->url}/\n";
         $body .= "Comments: {$this->comments}\n";
         $body .= "=======================================================";
         App::Alert($subject, $body);
     }
     Plugin::Trigger('comment.approve');
 }
Пример #19
0
 public function registerAction()
 {
     Input::flash();
     $data = Input::all();
     $nhc_config = Config::get('nhc/site.init_privacy');
     $rules = array('fname' => 'required', 'agency_id' => 'required', 'username' => 'required | alpha_dash', 'username' => 'required', 'password' => 'required | min:6 |same:password_confirmation', 'password_confirmation' => 'required', 'email' => 'required | email ');
     $messages = array('fname.required' => 'กรุณาระบุชื่อผู้ใช้งาน', 'agency_id.required' => 'กรุณาระหน่วยงานสังกัด', 'username.required' => 'กรุณาระบุชื่อผู้ใช้งาน', 'username.alpha_dash' => 'ชื่อผู้ใช้งานต้องประกอบด้วยตัวอักษร ตัวเลข หรืออันเดอร์สกอร์เท่านั้น', 'password.required' => 'กรุณาระบุรหัสผ่าน', 'password.min' => 'ความยามรหัสผ่านอย่างน้อย :min อักษร', 'password.same' => 'รหัสผ่านที่กรอกไม่ตรงกัน', 'password_confirmation.required' => 'กรุณาระบุรหัสผ่านอีกครั้ง', 'email.required' => 'กรุณาระบุอีเมล์', 'email.email' => 'รูปแบบอีเมล์ไม่ถูกต้อง');
     $validator = Validator::make($data, $rules, $messages);
     if ($validator->passes()) {
         $usernhc = new Usernhc();
         $ck_email = $usernhc->checkUserByEmail($data['email']);
         $ck_username = $usernhc->checkUsername($data['username']);
         if (!$ck_email && !$ck_username) {
             $usernhc->agency_id = $data['agency_id'];
             $usernhc->grp_id = $data['grp_id'];
             $usernhc->username = $data['username'];
             $usernhc->password = Hash::make($data['password']);
             $usernhc->email = $data['email'];
             $usernhc->fname = $data['fname'];
             $usernhc->lname = $data['lname'];
             $usernhc->telno = $data['telno'];
             $usernhc->status = $data['status'];
             $usernhc->save();
             //set basic privacy to new user
             $privacy = new Privacy();
             $privacy->userid = $usernhc->getUserIdByUserName($data['username']);
             // $privacy->fname = true;
             // $privacy->lname = false;
             // $privacy->email = false;
             // $privacy->telno = false;
             // $privacy->agency = false;
             // $privacy->ministry = false;
             // $privacy->role = false;
             $rs = PrivacyInit::all()->toArray();
             foreach ($rs as $key => $value) {
                 $result[$value['name_en']]['val'] = $value['init_value'];
                 $result[$value['name_en']]['th'] = $value['name_th'];
                 $result[$value['name_en']]['en'] = $value['name_en'];
             }
             $privacy->fname = $result['fname']['val'];
             $privacy->lname = $result['lname']['val'];
             $privacy->email = $result['email']['val'];
             $privacy->telno = $result['telno']['val'];
             $privacy->agency = $result['agency']['val'];
             $privacy->ministry = $result['ministry']['val'];
             $privacy->role = $result['role']['val'];
             $privacy->save();
             $role = new RoleUser();
             $role->role_id = 6;
             $role->user_id = $usernhc->getUserIdByUserName($data['username']);
             $role->save();
             return Redirect::route('login')->with('success', 'ระบบบันทึกการลงทะเบียนสำเร็จกรุณารอ 24 ชั่วโมงจึงจะสามารถเข้าใช้งานระบบได้');
         } else {
             return Redirect::route('regis')->withInput()->withErrors(array('message' => 'อีเมล์หรือชื่อผู้ใช้งานมีอยู่ในระบบแล้ว'));
         }
     } else {
         return Redirect::route('regis')->withErrors($validator);
     }
 }
Пример #20
0
		</div>
		<div class="large">
			<?
				$tag = '';
				if ($this->target->alliance) {
					$tag = '&nbsp;' . $this->target->getAlliance()->getTag();
				}
			?>
			<div class="line">
				<label>Username</label>
				<span><?php 
echo $this->target->getNameRecruit() . $tag;
?>
</span>
			</div>
			<? if (Privacy::isAdmin()) { ?>
				<div class="line">
					<span>
						<a href="admin-stats.php?uid=<?php 
echo $this->target->id;
?>
">Stats</a>
						(<?php 
echo $this->target->currentIP;
?>
)
					</span>
				</div>
			<? } ?>
			<div class="line">
				<span colspan="2" style="text-align:center;margin-left:0;">
Пример #21
0
	else {
		switch ($ret->active) {
			case 0:
				$_SESSION['activationId'] = $ret->id;
				header('Location: activate.php');
				exit;
			case 1:
				Privacy::login($ret->id);
				// Update the lastturntime
				$ret->save();
				header('Location: base.php');
				exit;
			case 2:
				if ($ret->vacation < time()) {					
					User::setActive($ret->id, 1);
					Privacy::login($ret->id);
					header('Location:base.php');
					exit;
				}
				else {
					$t->msg = 'You are set to vacation mode until ' . date("M d Y, H:i", $ret->vacation); 
				}
				
				break;
			case 3:
				// Must verify login credentials
				header('Location: loginverify.php');
				exit;
				break;
			case 4:
				$t->err = "You account has been suspended.";
Пример #22
0
<?php

/*
 * ©2013 Croce Rossa Italiana
 */
$p = Privacy::by('volontario', $me);
if ($p) {
    $p = new Privacy($p);
} else {
    $p = new Privacy();
}
$p->volontario = $me;
$p->contatti = $_POST['phoneradio'];
$p->mess = $_POST['messradio'];
$p->curriculum = $_POST['curriculumradio'];
$p->incarichi = $_POST['incarichiradio'];
$p->timestamp = time();
redirect('utente.privacy&ok');
Пример #23
0
	$save = array(
		'time' => time(),
		'METHOD' => $_SERVER['REQUEST_METHOD'],
		'REFERRER' => $_SERVER['HTTP_REFERRER'],
		'POST'=> $_POST,
		'GET'=> $_GET,
		'IP' => $_SERVER['REMOTE_ADDR'],
		'REQUEST_URI' => $_SERVER['REQUEST_URI'],
		'UA' => $_SERVER['HTTP_USER_AGENT'],
		'RESTORE'=> $restore_string,
		'SID' => session_id(),
	);
	$s = serialize($save) . "\n";
	unset($save);
	
	$userid = Privacy::getId();
	
	$dir = BASEDIR . '/logger/' . GAME;
	$filename = "$userid.log." . LOGGER_V;
	
	if (is_dir($dir)) {
	
		$f = fopen("$dir/$filename", 'a');
		fwrite($f, $s);
		fclose($f);
	
	}
	else {
		mkdir($dir, 666, true);
		
		$f = fopen("$dir/$filename", 'a');