* Modify website check.

This commit is contained in:
caoyanyi
2023-01-31 15:25:46 +08:00
parent 062200535c
commit 85ee9918c0
2 changed files with 28 additions and 16 deletions
+6 -15
View File
@@ -34,24 +34,15 @@ class admin extends control
$this->loadModel('misc');
/* Check internet. */
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.zentao.net/extension-apiGetExtensions.json');
curl_setopt($curl, CURLOPT_TIMEOUT_MS, 1000);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT_MS, 1000);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
$connected = (bool)curl_exec($curl);
curl_close($curl);
$clientLang = $this->app->getClientLang();
$hasInternet = $this->admin->checkInternet();
$clientLang = $this->app->getClientLang();
$this->view->title = $this->lang->admin->common;
$this->view->position[] = $this->lang->admin->index;
$this->view->extensions = $this->admin->getExtensionsByAPI('extension', 6, $connected);
$this->view->hasInternet = $connected;
$this->view->publicClass = ($connected and strpos($clientLang, 'zh') === 0) ? $this->admin->getPublicClassByAPI() : array();
$this->view->extensions = $this->admin->getExtensionsByAPI('extension', strpos($clientLang, 'zh') === 0 ? 6 : 5, $hasInternet);
$this->view->patches = $this->admin->getExtensionsByAPI('patch', 3, $hasInternet);
$this->view->hasInternet = $hasInternet;
$this->view->publicClass = ($hasInternet and strpos($clientLang, 'zh') === 0) ? $this->admin->getPublicClassByAPI() : array();
$this->view->clientLang = $clientLang;
$this->display();
}