403Webshell
Server IP : 103.48.194.25  /  Your IP : 216.73.216.74
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64
User : sieuthimay ( 1016)
PHP Version : 8.2.20
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/zomuaban.com/public_html/site/libraries/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/zomuaban.com/public_html/site/libraries/Trigger.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Trigger {
		

	###################################################################################################
	#
	#		NHÓM SỰ KIỆN AUTHENCATION
	#
	####################################################################################################
	
	public static function onLogin() {
		$CI = & get_instance();
				
		# TODO: Mỗi lần đăng nhập thì tìm tất cả item của user với email > xác nhận là của user này hết		
		#$CI->load->model('item_model');
		#$CI->item_model->set_my_items();
		# Hàm này gây chậm quá trình đăng nhập > Tìm cách khác để thay thế
		
		# TODO: Hiện notification về những sự kiện được thông báo
		
		
		
		# test mỗi lần đăng nhập thì cộng 10.000
		#$this->load->model('transaction_model');
		#$this->transaction_model->create(mine()->id,  9000, strTemp( 'Thưởng {} khi bạn đăng nhập vào AloGap mỗi ngày', 9000));
	}
	
	public static function onRegistry() {
		#TODO:
		# Mỗi lần đăng kí > Hiện hướng dẫn sử dụng
		
		
		# Nhận hết tin đăng này là của mình
		$CI = & get_instance();
		$CI->load->model('item_model');
		$CI->item_model->set_my_items();
		
		# Gửi mail xác nhận đăng ký		
		$user =  new stdClass();
		$user->email = mine()->email;
		$user->uName = mine()->name;
		
		$CI->load->library('emailsend');
		Emailsend::mailOnRegis($user);
		
		# Gửi tin nhắn chúc mừng 
		$mData 			= new stdclass;		
		$mData->content = getBlock('message/temp/welcome', array('user'=>mine()));
		$mData->receive = mine()->email;
		
		$CI->load->library('message');
		Message::sysNotify($mData);
		
		
		# test mỗi lần đăng nhập thì cộng 100.000	
		#$this->load->model('transaction_model');
		#$this->transaction_model->create(mine()->id, 100000, strTemp('Thưởng {} khi bạn đăng kí tài khoản', 100000));
		
	}
	
	
	###################################################################################################
	#
	#		NHÓM SỰ KIỆN ĐĂNG TIN
	#
	####################################################################################################
	
	#Sự kiện khi ĐĂNG TIN thành công
	public static function onCreateAd($item) {
			
		$CI = &get_instance();
		# Tạo tài khoản cho user này nếu chưa có tài khoản
		$CI->load->model('user_model');
		$user = $CI->user_model->get_user_by_email($item->email);
		if (!$user) {
			$user = new stdClass();
			$user->email 	= $item->email;
			$user->fullname = email2name($item->email);
			$user->password = random_string('sha1', 12);
			$user->phone 	= $item->phone;
			$user->address 	= $item->address;
			// Đăng kí > đăng nhập cho user nhưng ko active	
			$CI->authlib->register($user, false);	
		}else {
			// Đăng nhập cho user này luôn
			$CI->authlib->set_session($user);
		}
		
		# clone giá trị item ! (Rất quan trọng)
		$pData = clone $item;
		$pData->price 		= 0;
		$pData->totalView 	= 0;
		
		# Gửi mail xác nhận
		$CI->load->library('emailsend');
		Emailsend::mailOnCreateAd(full_item_prop($pData));
		
	}
	
	#Sự kiện khi UPDATE tin thành công
	public static function onUpdateAd($item) {
		
	}
	
	#Sự kiện khi LÀM MỚI tin thành công
	public static function onRenewAd($item) {
		
	}
	
	#Sự kiện khi ĐÃ BÁN sản phẩm
	public static function onSoldAd($item) {
		
	}
	
	#Sự kiện khi ĐÃ XÓA tin đăng
	public static function onRemoveAd($item) {
		
	}
	
	#Sự kiện khi REPORT tin đăng
	public static function onReportAd($item) {
		
	}
	
	###################################################################################################
	#
	#		NHÓM SỰ KIỆN SOCIAL : LIKE, SHARE, COMMENT
	#
	####################################################################################################
	public static function onComment() {
		
	}
	
	public static function onLike() {
		
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit