mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-26 03:30:48 +03:00
автоматическое создание config.local.php + проверка логина и мыла админа при инсталяции
This commit is contained in:
parent
bda8025737
commit
8f3cc04114
|
@ -972,6 +972,10 @@ class Install {
|
||||||
}
|
}
|
||||||
|
|
||||||
$sLocalConfigPath = $this->sConfigDir.'/config.local.php';
|
$sLocalConfigPath = $this->sConfigDir.'/config.local.php';
|
||||||
|
if(!file_exists($sLocalConfigPath) or !is_writeable($sLocalConfigPath)) {
|
||||||
|
// пытаемся создать файл локального конфига
|
||||||
|
@copy($this->sConfigDir.'/config.local.php.dist',$sLocalConfigPath);
|
||||||
|
}
|
||||||
if(!file_exists($sLocalConfigPath) or !is_writeable($sLocalConfigPath)) {
|
if(!file_exists($sLocalConfigPath) or !is_writeable($sLocalConfigPath)) {
|
||||||
$bOk = false;
|
$bOk = false;
|
||||||
$this->Assign('validate_local_config', '<span style="color:red;">'.$this->Lang('no').'</span>');
|
$this->Assign('validate_local_config', '<span style="color:red;">'.$this->Lang('no').'</span>');
|
||||||
|
@ -1428,12 +1432,12 @@ class Install {
|
||||||
$bOk = true;
|
$bOk = true;
|
||||||
$aErrors = array();
|
$aErrors = array();
|
||||||
|
|
||||||
if(!$sLogin=$this->GetRequest('install_admin_login',false) or strlen($sLogin)<3) {
|
if(!$sLogin=$this->GetRequest('install_admin_login',false) or !preg_match("/^[\da-z\_\-]{3,30}$/i",$sLogin)) {
|
||||||
$bOk = false;
|
$bOk = false;
|
||||||
$aErrors[] = $this->Lang('admin_login_invalid');
|
$aErrors[] = $this->Lang('admin_login_invalid');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$sMail=$this->GetRequest('install_admin_mail',false) or strlen($sMail)<5) {
|
if(!$sMail=$this->GetRequest('install_admin_mail',false) or !preg_match("/^[\da-z\_\-\.\+]+@[\da-z_\-\.]+\.[a-z]{2,5}$/i",$sMail)) {
|
||||||
$bOk = false;
|
$bOk = false;
|
||||||
$aErrors[] = $this->Lang('admin_mail_invalid');
|
$aErrors[] = $this->Lang('admin_mail_invalid');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue