remove user enable / disable, as the feature was ass, and better handled elsewhere :|
git-svn-id: file:///home/shish/svn/shimmie2/trunk@749 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
89df1557f0
commit
0b59c40865
5 changed files with 1 additions and 19 deletions
|
@ -8,7 +8,6 @@ class User {
|
|||
var $email;
|
||||
var $join_date;
|
||||
var $days_old;
|
||||
var $enabled;
|
||||
var $admin;
|
||||
|
||||
public function User($row) {
|
||||
|
@ -17,7 +16,6 @@ class User {
|
|||
$this->email = $row['email'];
|
||||
$this->join_date = $row['joindate'];
|
||||
$this->days_old = $row['days_old'];
|
||||
$this->enabled = ($row['enabled'] == 'Y');
|
||||
$this->admin = ($row['admin'] == 'Y');
|
||||
}
|
||||
|
||||
|
@ -26,17 +24,6 @@ class User {
|
|||
return ($this->id == $config->get_int('anon_id'));
|
||||
}
|
||||
|
||||
public function is_enabled() {
|
||||
return $this->enabled;
|
||||
}
|
||||
|
||||
public function set_enabled($enabled) {
|
||||
global $database;
|
||||
|
||||
$yn = $enabled ? 'Y' : 'N';
|
||||
$database->Execute("UPDATE users SET enabled=? WHERE id=?", array($yn, $this->id));
|
||||
}
|
||||
|
||||
public function is_admin() {
|
||||
return $this->admin;
|
||||
}
|
||||
|
|
|
@ -470,7 +470,7 @@ function _get_user() {
|
|||
$user = null;
|
||||
if(isset($_COOKIE["shm_user"]) && isset($_COOKIE["shm_session"])) {
|
||||
$tmp_user = $database->get_user_session($_COOKIE["shm_user"], $_COOKIE["shm_session"]);
|
||||
if(!is_null($tmp_user) && $tmp_user->is_enabled()) {
|
||||
if(!is_null($tmp_user)) {
|
||||
$user = $tmp_user;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
<field name="name" type="C" size="32"><notnull/></field>
|
||||
<field name="pass" type="C" size="32"></field>
|
||||
<field name="joindate" type="T"><notnull/></field>
|
||||
<field name="enabled" type="C" size="1"><notnull/><default value="Y"/></field>
|
||||
<field name="admin" type="C" size="1"><notnull/><default value="N"/></field>
|
||||
<field name="email" type="C" size="255"></field>
|
||||
<index name="users__name"><col>name</col><unique/></index>
|
||||
|
|
|
@ -308,11 +308,9 @@ class UserPage extends Extension {
|
|||
}
|
||||
else {
|
||||
$admin = (isset($_POST['admin']) && ($_POST['admin'] == "on"));
|
||||
$enabled = (isset($_POST['enabled']) && ($_POST['enabled'] == "on"));
|
||||
|
||||
$duser = $database->get_user_by_id($_POST['id']);
|
||||
$duser->set_admin($admin);
|
||||
$duser->set_enabled($enabled);
|
||||
|
||||
$page->set_mode("redirect");
|
||||
if($duser->id == $user->id) {
|
||||
|
|
|
@ -168,13 +168,11 @@ class UserPageTheme extends Themelet {
|
|||
|
||||
$i_user_id = int_escape($duser->id);
|
||||
$h_is_admin = $duser->is_admin() ? " checked" : "";
|
||||
$h_is_enabled = $duser->is_enabled() ? " checked" : "";
|
||||
|
||||
$html = "
|
||||
<form action='".make_link("user_admin/set_more")."' method='POST'>
|
||||
<input type='hidden' name='id' value='$i_user_id'>
|
||||
Admin: <input name='admin' type='checkbox'$h_is_admin>
|
||||
<br>Enabled: <input name='enabled' type='checkbox'$h_is_enabled>
|
||||
<p><input type='submit' value='Set'>
|
||||
</form>
|
||||
";
|
||||
|
|
Reference in a new issue