"bot" => array("googlebot", "mediapartners-google", "adsbot-google", "duckduckbot", "msnbot", "bingbot", "ask", "facebook", "yahoo", "addthis") ); foreach($devicesTypes as $deviceType => $devices) { foreach($devices as $device) { if(preg_match("/" . $device . "/i", $userAgent)) { $deviceName = $deviceType; } } } return ucfirst($deviceName); } /** * Generates GUID * @return string */ function guid() { if (function_exists('com_create_guid')) {
foreach($devices as $device) { if(preg_match("/" . $device . "/i", $userAgent)) { $deviceName = $deviceType; } } } return ucfirst($deviceName); } /** * Generates GUID * @return string */
$this->form_type = $this->scenario; $this->form_page = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $this->date_submitted = date('Y_m-d H:i:s'); $this->ip_address = getRealIpAddress(); $this->browser = browser_detect(); $this->device = device_detect(); $this->os = operating_system_detect(); //$details = json_decode(file_get_contents("http://ipinfo.io/".$this->ip_address."/json")); //if ($this->country=='' && isset($details->country)) // $this->country = $details->country;
* @param array $attributes list of attributes that need to be saved. Defaults to null, * meaning all attributes that are loaded from DB will be saved. * @return boolean whether the record is inserted successfully. */ protected function insertInternal($attributes = null) { if (!$this->beforeSave(true)) { return false; } $values = $this->getDirtyAttributes($attributes); if (empty($values)) { foreach ($this->getPrimaryKey(true) as $key => $value) { $values[$key] = $value;
if ($runValidation && !$this->validate($attributes)) { Yii::info('Model not inserted due to validation error.', __METHOD__); return false; } if (!$this->isTransactional(self::OP_INSERT)) { return $this->insertInternal($attributes); } $transaction = static::getDb()->beginTransaction(); try { $result = $this->insertInternal($attributes); if ($result === false) {
* meaning all attributes that are loaded from DB will be saved. * @return boolean whether the saving succeeds */ public function save($runValidation = true, $attributeNames = null) { if ($this->getIsNewRecord()) { return $this->insert($runValidation, $attributeNames); } else { return $this->update($runValidation, $attributeNames) !== false; } } /**
public function logDownload() { $log = new FormSubmissions(); $log->scenario = 'unanimous_download'; $log->product = $this->idproducts; $log->form_title = $this->title; $log->save(false); } public function getProduct() { return $this->hasOne(Products::className(), ['idproducts'=>'idproducts']); } }
*/ public function actionDownload($file) { if (isset($file) && $file!='') { $file = Files::find()->where('idfiles = :idf')->params(['idf'=>$file])->one(); if ($file!=null) { $file->logDownload(); $this->giveTheFile($file->filenamedownload, Yii::$app->params['filesDir'] . $file->filename); } } }
$args = $this->controller->bindActionParams($this, $params); Yii::trace('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__); if (Yii::$app->requestedParams === null) { Yii::$app->requestedParams = $args; } return call_user_func_array([$this->controller, $this->actionMethod], $args); } }
} $result = null; if ($runAction && $this->beforeAction($action)) { // run the action $result = $action->runWithParams($params); $result = $this->afterAction($action, $result); // call afterAction on modules foreach ($modules as $module) { /* @var $module Module */
$parts = $this->createController($route); if (is_array($parts)) { /* @var $controller Controller */ list($controller, $actionID) = $parts; $oldController = Yii::$app->controller; Yii::$app->controller = $controller; $result = $controller->runAction($actionID, $params); Yii::$app->controller = $oldController; return $result; } else { $id = $this->getUniqueId(); throw new InvalidRouteException('Unable to resolve the request "' . ($id === '' ? $route : $id . '/' . $route) . '".');
$params = $this->catchAll; unset($params[0]); } try { Yii::trace("Route requested: '$route'", __METHOD__); $this->requestedRoute = $route; $result = $this->runAction($route, $params); if ($result instanceof Response) { return $result; } else { $response = $this->getResponse(); if ($result !== null) { $response->data = $result;
try { $this->state = self::STATE_BEFORE_REQUEST; $this->trigger(self::EVENT_BEFORE_REQUEST); $this->state = self::STATE_HANDLING_REQUEST; $response = $this->handleRequest($this->getRequest()); $this->state = self::STATE_AFTER_REQUEST; $this->trigger(self::EVENT_AFTER_REQUEST); $this->state = self::STATE_SENDING_RESPONSE; $response->send();
require(__DIR__ . '/../../_yii2_profilesmecom/vendor/autoload.php'); require(__DIR__ . '/../../_yii2_profilesmecom/vendor/yiisoft/yii2/Yii.php'); require(__DIR__ . '/../functions.php'); $config = require(__DIR__ . '/../../_yii2_profilesmecom/config/web.php'); (new yii\web\Application($config))->run();
$_GET = [ 'file' => '3578609283', ]; $_SERVER = [ 'PATH' => '/sbin:/usr/sbin:/bin:/usr/bin', 'DOCUMENT_ROOT' => '/home/www/profilesme.com', 'SCRIPT_NAME' => '/ar/index.php', 'SCRIPT_FILENAME' => '/home/www/profilesme.com/ar/index.php', 'PHP_VERSION' => '56', 'PYTHON_VERSION' => '35', 'CHROOT_HOST' => '0', 'SB' => '0', 'PHP_FCGI_MAX_REQUESTS' => '500', 'PHP_INI_SCAN_DIR' => '/home/tmp/php', 'HTTP_CONNECTION' => 'close', 'PH3_SCRIPT_FILENAME' => '/services/users/zstorage11p1/adamlina/www/profilesme.com/ar/index.php', 'PH3_SCRIPT_NAME' => '/ar/index.php', 'PH3_DOCUMENT_ROOT' => '/services/users/zstorage11p1/adamlina/www/profilesme.com', 'REQUEST_URI' => '/ar/download?file=3578609283', 'QUERY_STRING' => 'file=3578609283', 'REQUEST_METHOD' => 'GET', 'SERVER_PROTOCOL' => 'HTTP/2.0', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'REDIRECT_QUERY_STRING' => 'file=3578609283', 'REDIRECT_URL' => '/ar/download', 'REMOTE_PORT' => '40560', 'SERVER_ADMIN' => '[no address given]', 'CONTEXT_DOCUMENT_ROOT' => '/services/users/zstorage11p1/adamlina/www/profilesme.com', 'CONTEXT_PREFIX' => '', 'REQUEST_SCHEME' => 'https', 'REMOTE_ADDR' => '3.88.60.5', 'SERVER_PORT' => '443', 'SERVER_ADDR' => '162.210.96.127', 'SERVER_NAME' => 'www.profilesme.com', 'SERVER_SOFTWARE' => 'Apache', 'SERVER_SIGNATURE' => '', 'LD_LIBRARY_PATH' => '/services/apache/lib/openssl-1.1.1/lib:/services/apache/lib/curl/lib/:/services/apache/lib/', 'HTTP_HOST' => 'www.profilesme.com', 'HTTP_USER_AGENT' => 'claudebot', 'HTTP_ACCEPT' => '*/*', 'H2_STREAM_TAG' => '21692-7823-3', 'H2_STREAM_ID' => '3', 'H2_PUSHED_ON' => '', 'H2_PUSHED' => '', 'H2_PUSH' => 'off', 'H2PUSH' => 'off', 'HTTP2' => 'on', 'SSL_TLS_SNI' => 'www.profilesme.com', 'HTTPS' => 'on', 'vhost_ph3_PATH' => '/services/users/zstorage11p1/adamlina/www/profilesme.com', 'SECURITY' => 'detect', 'UID' => '20302', 'UNIQUE_ID' => 'ZgXEUFAW6Ub9BjtROV6TdAACphE', 'REDIRECT_STATUS' => '200', 'REDIRECT_H2_STREAM_TAG' => '21692-7823-3', 'REDIRECT_H2_STREAM_ID' => '3', 'REDIRECT_H2_PUSHED_ON' => '', 'REDIRECT_H2_PUSHED' => '', 'REDIRECT_H2_PUSH' => 'off', 'REDIRECT_H2PUSH' => 'off', 'REDIRECT_HTTP2' => 'on', 'REDIRECT_SSL_TLS_SNI' => 'www.profilesme.com', 'REDIRECT_HTTPS' => 'on', 'REDIRECT_vhost_ph3_PATH' => '/services/users/zstorage11p1/adamlina/www/profilesme.com', 'REDIRECT_DOCUMENT_ROOT' => '/services/users/zstorage11p1/adamlina/www/profilesme.com', 'REDIRECT_SECURITY' => 'detect', 'REDIRECT_SB' => '0', 'REDIRECT_CHROOT_HOST' => '0', 'REDIRECT_PYTHON_VERSION' => '35', 'REDIRECT_PHP_VERSION' => '56', 'REDIRECT_UID' => '20302', 'REDIRECT_UNIQUE_ID' => 'ZgXEUFAW6Ub9BjtROV6TdAACphE', 'FCGI_ROLE' => 'RESPONDER', 'PHP_SELF' => '/ar/index.php', 'REQUEST_TIME_FLOAT' => 1711653969.1762359, 'REQUEST_TIME' => 1711653969, ]; $_SESSION = [ '__flash' => [], 'currentLang' => 'ar-AE', ];