Exemple #1
0
 protected function set_guid()
 {
     $strGuid = APF::get_instance()->get_request()->get_cookie("aQQ_ajkguid");
     if (empty($strGuid) || strlen($strGuid) != 36) {
         apf_require_class("Util_Guid");
         $CGuid = new Util_Guid();
         $strGuid = $CGuid->toString();
         APF::get_instance()->get_response()->set_cookie('aQQ_ajkguid', $strGuid, 3600 * 24 * 365);
         unset($CGuid);
     }
     APF::get_instance()->get_request()->set_guid($strGuid);
 }
 public function addAction()
 {
     $this->buildForm("admin/group/save");
     $this->gForm->getElement('tmp_id')->setValue(Util_Guid::generate());
     $this->gForm->getElement('url')->setValue('http://');
     $this->gForm->getElement('user_responsible')->setValue(UGD_Login_Manager::getInstance()->getActiveUser()->getId());
 }
Exemple #3
0
 /**
  * 执行Action前执行
  *
  * @see Yaf_Controller::actionBefore()
  */
 public function actionBefore()
 {
     Model_ActionLog::setType(Model_ActionLog::TYPE_FRONT);
     $this->_frame = 'frame.phtml';
     // 访问者的GUID
     $this->sVistorGuid = Util_Cookie::get('guid');
     if (empty($this->sVistorGuid)) {
         $this->sVistorGuid = Util_Guid::get('-');
         Util_Cookie::set('guid', $this->sVistorGuid, 86400 * 365);
     }
     $this->assign('sStaticRoot', 'http://' . Yaf_G::getConf('static', 'domain'));
 }
Exemple #4
0
 /**
  * 
  */
 public function __construct()
 {
     $this->handle = Util_Guid::generate();
     $this->logger = Util_Log::get()->UGAMON_Mng();
 }
Exemple #5
0
define('UGUID_KEY', 'uguid');
define('CLIENT_IP_KEY', 'cip');
define('REFERER_KEY', 'referer');
define('USER_AGENT_KEY', 'agent');
define('CLIENT_STAMP_KEY', 'cstamp');
define('EXECPTION_REASON_KEY', 'reason');
define('URL_KEY', 'url');
define('MSG_KEY', 'msg');
define('LINE_NUMBER_KEY', 'line');
include 'Guid.php';
include 'func.php';
// cookie
if (isset($_COOKIE[COOKIE_NAME]) && !empty($_COOKIE[COOKIE_NAME])) {
    $sguid = $_COOKIE[COOKIE_NAME];
} else {
    $CGuid = new Util_Guid();
    $sguid = $CGuid->toString();
    setcookie(COOKIE_NAME, $sguid, 4102415999);
}
// build
list($usec, $sec) = explode(' ', microtime());
$log[STAMP_KEY] = (string) $sec . sprintf('%03d', (int) ($usec * 1000));
$log[UGUID_KEY] = $sguid;
$log[CLIENT_IP_KEY] = (string) get_client_ip();
$log[CLIENT_STAMP_KEY] = (string) @$_GET['t'];
$log[REFERER_KEY] = (string) @$_GET['rf'];
$log[USER_AGENT_KEY] = (string) @$_SERVER['HTTP_USER_AGENT'];
$log[EXECPTION_REASON_KEY] = (string) @$_GET['r'];
$log[URL_KEY] = (string) @$_GET['u'];
$log[MSG_KEY] = (string) @$_GET['m'];
$log[LINE_NUMBER_KEY] = (string) @$_GET['l'];