Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 30 lines (25 sloc) 0.905 kb
26b4753 @vrana Update plugins
authored
1 <?php
2 /* Requires this table:
3 CREATE TABLE login (
4 id int NOT NULL AUTO_INCREMENT, -- optional
5 login varchar(30) NOT NULL, -- any length
6 password_sha1 char(40) NOT NULL,
7 UNIQUE (login),
8 PRIMARY KEY (id)
9 );
10 */
11
12 /** Authenticate a user from the login table
13 * @author Jakub Vrana, http://www.vrana.cz/
14 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
15 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
16 */
17 class AdminerLoginTable {
18 var $database;
19
20 function AdminerLoginTable($database) {
21 $this->database = $database;
22 }
23
24 function login($login, $password) {
25 $connection = connection();
26 return (bool) $connection->result($q = "SELECT COUNT(*) FROM " . idf_escape($this->database) . ".login WHERE login = " . $connection->quote($login) . " AND password_sha1 = " . $connection->quote(sha1($password)));
27 }
28
29 }
Something went wrong with that request. Please try again.