mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-21 18:37:31 +08:00
fix management create user
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.0');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-01-06');
|
||||
defined('RELEASE_DATE') || define('RELEASE_DATE', '2023-01-07');
|
||||
defined('IN_TRACKER') || define('IN_TRACKER', false);
|
||||
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
|
||||
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");
|
||||
|
||||
@@ -1485,8 +1485,8 @@ function check_email ($email) {
|
||||
if(!preg_match('/^[A-Za-z0-9][A-Za-z0-9_.+\-]*@[A-Za-z0-9][A-Za-z0-9_+\-]*(\.[A-Za-z0-9][A-Za-z0-9_+\-]*)+$/', $email)) {
|
||||
return false;
|
||||
}
|
||||
$bannedEmails = mysql_fetch_assoc(sql_query('select * from bannedemails'));
|
||||
$bannedEmailsArr = preg_split('/[\s]+/', $bannedEmails['value'] ?? '');
|
||||
$bannedEmails = \Nexus\Database\NexusDB::select('select * from bannedemails');
|
||||
$bannedEmailsArr = preg_split('/[\s]+/', $bannedEmails[0]['value'] ?? '');
|
||||
if (empty($bannedEmailsArr)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1112,3 +1112,19 @@ function get_passkey_by_authkey($authkey)
|
||||
return $userInfo->passkey;
|
||||
});
|
||||
}
|
||||
|
||||
function executeCommand($command, $format = 'string'): string|array
|
||||
{
|
||||
$append = " 2>&1";
|
||||
if (!str_ends_with($command, $append)) {
|
||||
$command .= $append;
|
||||
}
|
||||
do_log("command: $command");
|
||||
$result = exec($command, $output, $result_code);
|
||||
$outputString = implode("\n", $output);
|
||||
do_log(sprintf('result_code: %s, result: %s, output: %s', $result_code, $result, $outputString));
|
||||
if ($result_code != 0) {
|
||||
throw new \RuntimeException($outputString);
|
||||
}
|
||||
return $format == 'string' ? $outputString : $output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user