13 $userId = Yii::app()->user->id;
18 foreach (
$json[0] as $key => $value) {
21 $json[0][$key] = $value;
26 $reqFile = tempnam(Yii::app()->getBasePath() .
'/json_temp',
'');
27 $request = fopen($reqFile,
"w");
28 fwrite($request,
$json);
33 Yii::app()->user->setFlash(
'error1', $this->operation .
' ERROR: ' . $error);
35 Yii::app()->user->setFlash(
'success1', $this->operation .
': SUCCESS');
39 $UsersSitesRights->setRightsSingleRecord(
51 $request = Yii::app()->getRequest();
56 'charset' => $request->getPost(
'charset'),
57 'contentMask' => null,
58 'contentType' => $request->getPost(
'contentType'),
59 'contentURLMd5' => null,
61 'crawlingTime' => null,
67 'httpMethod' => $request->getPost(
'httpMethod'),
68 'httpTimeout' => $request->getPost(
'httpTimeout'),
69 'lastModified' => null,
73 'mRateCounter' => null,
74 'maxURLsFromPage' => $request->getPost(
'maxURLsFromPage'),
77 'priority' => $request->getPost(
'priority'),
79 'processingDelay' => $request->getPost(
'processingDelay'),
80 'processingTime' => null,
81 'rawContentMd5' => null,
82 'requestDelay' => $request->getPost(
'requestDelay'),
83 'siteId' => $request->getPost(
'siteId'),
86 'state' => $request->getPost(
'state'),
87 'status' => $request->getPost(
'status'),
92 'type' => $request->getPost(
'type'),
93 'url' => $request->getPost(
'url'),
94 'urlMd5' => $request->getPost(
'urlMd5'),
102 $api = Yii::app()->params[
'api'];
103 $path = Yii::app()->getBasePath() .
'/shell/';
104 $cmd =
"sh " . $path .
"url_update.sh $api $reqFile";
105 $json = shell_exec($cmd);