define('PERMISSION_SPAMFILTER_ADD', 'sf_add');
/** Can delete spamfilter entries */
define('PERMISSION_SPAMFILTER_DEL', 'sf_del');
+/** Can rehash servers */
+define('PERMISSION_REHASH', 'rhs');
/**
* PanelUser
* This is the User class for the SQL_Auth plugin
$user["name"] = $name;
$user["id"] = $id;
$user["object"] = NULL;
-
Hook::run(HOOKTYPE_USER_LOOKUP, $user);
foreach ($user['object'] as $key => $value)
$this->$key = $value;
$this->user_meta['permissions'] = serialize($meta);
}
+ /** Updates core user info.
+ * CAUTION: Updating a non-existent column will crash
+ * your shit
+ */
+ function update_core_info($array)
+ {
+ $arr = ['info' => $array, 'user' => $this];
+ Hook::run(HOOKTYPE_EDIT_USER, $arr);
+ }
}
$arr["id"] = $id;
$arr['meta'] = &$array;
Hook::run(HOOKTYPE_USERMETA_GET, $arr);
- do_log($array);
$this->list = $arr['meta'];
}
$user['fname'] = (isset($user['fname'])) ? htmlspecialchars($user['fname']) : NULL;
$last['lname'] = (isset($user['lname'])) ? htmlspecialchars($user['lname']) : NULL;
$user['user_bio'] = (isset($user['user_bio'])) ? htmlspecialchars($user['user_bio']) : NULL;
+ $user['email'] = (isset($user['user_email'])) ? htmlspecialchars($user['user_email']) : NULL;
if (($u = new PanelUser($user['user_name']))->id)
{
function current_user_can($permission) : bool
{
$user = unreal_get_current_user();
+ if (!$user)
+ return false;
return user_can($user, $permission);
}
$list = [
"Can add/delete/edit Admin Panel users" => PERMISSION_MANAGE_USERS,
"Can ban/kill IRC users" => PERMISSION_BAN_USERS,
- "Can hange properties of a user, i.e. vhost, modes and more" => PERMISSION_EDIT_USER,
+ "Can change properties of a user, i.e. vhost, modes and more" => PERMISSION_EDIT_USER,
"Can change properties of a channel, i.e. topic, modes and more" => PERMISSION_EDIT_CHANNEL,
- "Change properties of a user on a channel i.e give/remove voice or ops and more" => PERMISSION_EDIT_CHANNEL_USER,
+ "Can change properties of a user on a channel i.e give/remove voice or ops and more" => PERMISSION_EDIT_CHANNEL_USER,
"Can add manual bans, including G-Lines, Z-Lines and more" => PERMISSION_SERVER_BAN_ADD,
"Can remove set bans, including G-Lines, Z-Lines and more" => PERMISSION_SERVER_BAN_DEL,
"Can forbid usernames and channels" => PERMISSION_NAME_BAN_ADD,
<?php
}
-}
\ No newline at end of file
+}