mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
remove leech warn
This commit is contained in:
@@ -45,7 +45,7 @@ class NexusUpdate extends Command
|
||||
require ROOT_PATH . 'nexus/Database/helpers.php';
|
||||
//Step 1
|
||||
$step = $this->update->currentStep();
|
||||
$log = "Step 1, Checking environment...";
|
||||
$log = sprintf('Step %s, %s...', $step, $this->update->getStepName($step));
|
||||
$this->doLog($log);
|
||||
$requirements = $this->update->listRequirementTableRows();
|
||||
$fails = $requirements['fails'];
|
||||
@@ -58,17 +58,17 @@ class NexusUpdate extends Command
|
||||
$this->update->gotoStep(++$step);
|
||||
|
||||
//Step 2
|
||||
$log = "Step 2, get files, cli skip...";
|
||||
$log = sprintf('Step %s, %s, cli skip...', $step, $this->update->getStepName($step));
|
||||
$this->doLog($log);
|
||||
$this->update->gotoStep(++$step);
|
||||
|
||||
//Step 3
|
||||
$log = "Step 3, update .env, cli skip...";
|
||||
$log = sprintf('Step %s, %s, cli skip...', $step, $this->update->getStepName($step));
|
||||
$this->doLog($log);
|
||||
$this->update->gotoStep(++$step);
|
||||
|
||||
//Step 4
|
||||
$log = "Step 4, perform update...";
|
||||
$log = sprintf('Step %s, %s...', $step, $this->update->getStepName($step));
|
||||
$this->doLog($log);
|
||||
$settingTableRows = $this->update->listSettingTableRows();
|
||||
$settings = $settingTableRows['settings'];
|
||||
|
||||
@@ -282,6 +282,22 @@ class UserRepository extends BaseRepository
|
||||
return true;
|
||||
}
|
||||
|
||||
public function removeLeechWarn($operator, $uid): bool
|
||||
{
|
||||
if (!$operator instanceof User) {
|
||||
$operator = User::query()->findOrFail(intval($operator), User::$commonFields);
|
||||
}
|
||||
$classRequire = Setting::get('authority.prfmanage');
|
||||
if ($operator->class < $classRequire) {
|
||||
throw new \RuntimeException("No permission.");
|
||||
}
|
||||
$user = User::query()->findOrFail($uid, User::$commonFields);
|
||||
NexusDB::cache_del('user_'.$uid.'_content');
|
||||
$user->leechwarn = 'no';
|
||||
$user->leechwarnuntil = null;
|
||||
return $user->save();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user