]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
Merge pull request #16 from PeGaSuS-Coder/patch-4
authorValerie Pond <redacted>
Tue, 21 Mar 2023 22:19:33 +0000 (22:19 +0000)
committerGitHub <redacted>
Tue, 21 Mar 2023 22:19:33 +0000 (22:19 +0000)
Update class-paneluser.php

1  2 
Classes/class-paneluser.php

index 2cdc6c9f258363814ccf9310de916ec82167dcfb,df27b4d53fb74f48411123af1d6eaa9ff7cbac15..c813992813780dc57363b7a21000a40e3e906a1f
@@@ -25,8 -25,6 +25,8 @@@ define('PERMISSION_BAN_EXCEPTION_DEL', 
  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
@@@ -53,6 -51,7 +53,6 @@@ class PanelUse
                $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);
 +      }
  }
  
  
@@@ -158,6 -148,7 +158,6 @@@ class PanelUser_Met
                $arr["id"] = $id;
                $arr['meta'] = &$array;
                Hook::run(HOOKTYPE_USERMETA_GET, $arr);
 -              do_log($array);
                $this->list = $arr['meta'];
                
        }
@@@ -234,8 -225,6 +234,8 @@@ function unreal_get_current_user() : Pa
  function current_user_can($permission) : bool
  {
        $user = unreal_get_current_user();
 +      if (!$user)
 +              return false;
        return user_can($user, $permission);
  }
  
@@@ -288,7 -277,7 +288,7 @@@ function get_panel_user_permission_list
                "Can ban/kill IRC users" => PERMISSION_BAN_USERS,
                "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,