there are some odd cases where anonymous is not user #1, so use the anon_id variable
This commit is contained in:
		
							parent
							
								
									33606444ca
								
							
						
					
					
						commit
						f38b45e2a9
					
				@ -487,14 +487,14 @@ class UserPage extends SimpleExtension {
 | 
			
		||||
					"You need to specify the account number to edit"));
 | 
			
		||||
		}
 | 
			
		||||
		else{
 | 
			
		||||
			$rows = $database->get_all("SELECT * FROM images WHERE owner_id = :owner_id", array("owner_id" => $_POST['id']));
 | 
			
		||||
			foreach ($rows as $key => $value)
 | 
			
		||||
			{
 | 
			
		||||
				$database->Execute("UPDATE images SET owner_id = :owner_id WHERE id = :id;", array("owner_id" => 1, "id" => $value['id']));
 | 
			
		||||
			}
 | 
			
		||||
			$database->execute("DELETE FROM users 
 | 
			
		||||
								WHERE id = :id"
 | 
			
		||||
								, array("id"=>$_POST['id']));
 | 
			
		||||
			$database->Execute(
 | 
			
		||||
				"UPDATE images SET owner_id = :new_owner_id WHERE owner_id = :old_owner_id",
 | 
			
		||||
				array("new_owner_id" => $config->get_int('anon_id'), "old_owner_id" => $_POST['id'])
 | 
			
		||||
			);
 | 
			
		||||
			$database->execute(
 | 
			
		||||
				"DELETE FROM users WHERE id = :id",
 | 
			
		||||
				array("id" => $_POST['id'])
 | 
			
		||||
			);
 | 
			
		||||
		
 | 
			
		||||
			$page->set_mode("redirect");
 | 
			
		||||
			$page->set_redirect(make_link("post/list"));
 | 
			
		||||
 | 
			
		||||
@ -150,7 +150,7 @@ class UserPageTheme extends Themelet {
 | 
			
		||||
	protected function build_options(User $duser) {
 | 
			
		||||
		global $config, $database, $user;
 | 
			
		||||
		$html = "";
 | 
			
		||||
		if($duser->id != 1){  //justa fool-admin protection so they dont mess around with anon users.
 | 
			
		||||
		if($duser->id != $config->get_int('anon_id')){  //justa fool-admin protection so they dont mess around with anon users.
 | 
			
		||||
		
 | 
			
		||||
			$html .= "
 | 
			
		||||
			".make_form(make_link("user_admin/change_pass"))."
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user