Move authenticate to end, remove isBanned()
This commit is contained in:
		
							parent
							
								
									3e52400d52
								
							
						
					
					
						commit
						b91e7aa171
					
				
							
								
								
									
										27
									
								
								defense.php
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								defense.php
									
									
									
									
									
								
							| @ -206,17 +206,6 @@ class defense extends rcube_plugin { | |||||||
|         return $content |         return $content | ||||||
|     } |     } | ||||||
|      |      | ||||||
|   /** |  | ||||||
|     * Hooked function: authenticate($host, $user, $cookiecheck, $valid) |  | ||||||
|     * Login attempt intercepted if IP is banned. |  | ||||||
|     * |  | ||||||
|     * @param var (untouched) |  | ||||||
|     * @return var (untouched) |  | ||||||
|     */ |  | ||||||
|     public function hookAuthenticate($args) { |  | ||||||
|         return $args; |  | ||||||
|     } |  | ||||||
|      |  | ||||||
|   /** |   /** | ||||||
|     * Hooked function: login_failed($host, $user, $code) |     * Hooked function: login_failed($host, $user, $code) | ||||||
|     * Log event to database |     * Log event to database | ||||||
| @ -281,18 +270,18 @@ class defense extends rcube_plugin { | |||||||
| 
 | 
 | ||||||
|          |          | ||||||
|     } |     } | ||||||
|      | 
 | ||||||
|      |  | ||||||
|   /** |   /** | ||||||
|     * Return true if logs indicate given IP is banned |     * Hooked function: authenticate($host, $user, $cookiecheck, $valid) | ||||||
|  |     * Login attempt intercepted if IP is banned. | ||||||
|     * |     * | ||||||
|     * @param string ip |     * @param var (untouched) | ||||||
|     * @return bool |     * @return var (untouched) | ||||||
|     *  |  | ||||||
|     */ |     */ | ||||||
|     public function isBanned($ip) { |     public function hookAuthenticate($args) { | ||||||
|         $query = "SELECT count(id) FROM " . $this->db_table . " WHERE ip = ? AND "; |         return $args; | ||||||
|     } |     } | ||||||
|  |      | ||||||
| } | } | ||||||
|   |   | ||||||
|   |   | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user