mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
Refactoring user permissions
This commit is contained in:
@@ -174,6 +174,7 @@ return array (
|
||||
'userbar' => '2',
|
||||
'view_special_torrent' => '4',
|
||||
'torrent_hr' => User::CLASS_ADMINISTRATOR,
|
||||
'torrent-approval' => User::CLASS_ADMINISTRATOR,
|
||||
),
|
||||
'tweak' =>
|
||||
array (
|
||||
|
||||
@@ -25,4 +25,15 @@ abstract class BasePlugin extends BaseRepository
|
||||
Artisan::call($toExecute);
|
||||
}
|
||||
}
|
||||
|
||||
public function checkMainApplicationVersion()
|
||||
{
|
||||
$constantName = "static::COMPATIBLE_VERSION";
|
||||
if (defined($constantName) && version_compare(VERSION_NUMBER, constant($constantName), '<')) {
|
||||
throw new \RuntimeException(sprintf(
|
||||
"NexusPHP version: %s is too low, this plugin require: %s",
|
||||
VERSION_NUMBER, constant($constantName)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class Hook
|
||||
$args = func_get_args();
|
||||
ksort(self::$callbacks[$name]);
|
||||
reset(self::$callbacks[$name]);
|
||||
do_log("name: $name, argc: " . (func_num_args() - 1));
|
||||
// do_log("name: $name, argc: " . (func_num_args() - 1));
|
||||
do {
|
||||
foreach ((array)current(self::$callbacks[$name]) as $id => $callback) {
|
||||
$args[1] = $value;
|
||||
@@ -65,7 +65,7 @@ class Hook
|
||||
$args = func_get_args();
|
||||
ksort(self::$callbacks[$name]);
|
||||
reset(self::$callbacks[$name]);
|
||||
do_log("name: $name, argc: " . (func_num_args() - 1));
|
||||
// do_log("name: $name, argc: " . (func_num_args() - 1));
|
||||
do {
|
||||
foreach ((array)current(self::$callbacks[$name]) as $id => $callback) {
|
||||
// do_log("name: $name, id: $id, before, params: " . nexus_json_encode(array_slice($args, 1, $callback['argc'])));
|
||||
|
||||
Reference in New Issue
Block a user