mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
fix management create user
This commit is contained in:
@@ -157,6 +157,11 @@ class NexusUpdate extends Command
|
||||
$this->update->runExtraMigrate();
|
||||
$this->doLog("runExtraMigrate done!");
|
||||
|
||||
$logFile = getLogFile();
|
||||
$command = "chmod 777 $logFile";
|
||||
$this->doLog("$command...");
|
||||
executeCommand($command);
|
||||
|
||||
$this->doLog("All done!");
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -95,7 +95,7 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$r = NexusDB::cache_get('category_content');
|
||||
$r = getLogFile();
|
||||
dd($r);
|
||||
}
|
||||
|
||||
|
||||
@@ -57,18 +57,7 @@ class BaseRepository
|
||||
|
||||
protected 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;
|
||||
return executeCommand($command, $format);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -101,8 +101,11 @@ class BonusRepository extends BaseRepository
|
||||
|
||||
public function consumeToBuyTemporaryInvite($uid, $count = 1): bool
|
||||
{
|
||||
$user = User::query()->findOrFail($uid);
|
||||
$requireBonus = BonusLogs::getBonusForBuyTemporaryInvite();
|
||||
if ($requireBonus <= 0) {
|
||||
throw new \RuntimeException("Temporary invite require bonus <= 0 !");
|
||||
}
|
||||
$user = User::query()->findOrFail($uid);
|
||||
$toolRep = new ToolRepository();
|
||||
$hashArr = $toolRep->generateUniqueInviteHash([], $count, $count);
|
||||
NexusDB::transaction(function () use ($user, $requireBonus, $hashArr) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -76,13 +76,16 @@ function bonusarray($option = 0){
|
||||
$results[] = $bonus;
|
||||
|
||||
//Tmp Invite
|
||||
$bonus = array();
|
||||
$bonus['points'] = \App\Models\BonusLogs::getBonusForBuyTemporaryInvite();
|
||||
$bonus['art'] = 'tmp_invite';
|
||||
$bonus['menge'] = 1;
|
||||
$bonus['name'] = $lang_mybonus['text_buy_tmp_invite'];
|
||||
$bonus['description'] = $lang_mybonus['text_buy_tmp_invite_note'];
|
||||
$results[] = $bonus;
|
||||
$tmpInviteBonus = \App\Models\BonusLogs::getBonusForBuyTemporaryInvite();
|
||||
if ($tmpInviteBonus > 0) {
|
||||
$bonus = array();
|
||||
$bonus['points'] = $tmpInviteBonus;
|
||||
$bonus['art'] = 'tmp_invite';
|
||||
$bonus['menge'] = 1;
|
||||
$bonus['name'] = $lang_mybonus['text_buy_tmp_invite'];
|
||||
$bonus['description'] = $lang_mybonus['text_buy_tmp_invite_note'];
|
||||
$results[] = $bonus;
|
||||
}
|
||||
|
||||
//Custom Title
|
||||
$bonus = array();
|
||||
|
||||
Reference in New Issue
Block a user