fix management create user

This commit is contained in:
xiaomlove
2023-01-07 16:27:27 +08:00
parent ad6e66ce56
commit 3cc0d364a8
8 changed files with 40 additions and 24 deletions
+1 -1
View File
@@ -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");
+2 -2
View File
@@ -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;
}
+16
View File
@@ -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;
}