mirror of
https://github.com/moparisthebest/user_sql
synced 2025-02-16 06:50:16 -05:00
Updated README
Fixed getUsers() bug that prevented admin interface to show user list correctly
This commit is contained in:
parent
539c4b56ef
commit
3bee033569
@ -3,8 +3,13 @@ user_sql
|
||||
|
||||
Owncloud SQL authentification
|
||||
|
||||
This is plugin is heavily based on user_imap, user_pwauth and user_ldap!
|
||||
This is plugin is heavily based on user_imap, user_pwauth, user_ldap and user_redmine!
|
||||
|
||||
Enable it in your Admin -> Apps section and configure your server's details.
|
||||
Currently, it only works with mySQL and the crypt() password encryption string.
|
||||
Currently, it supports most of postfixadmin's encryption options, except dovecot and saslauthd.
|
||||
It was tested and developed for a postfixadmin database.
|
||||
|
||||
Credits
|
||||
|
||||
* Johan Hendriks provided his user_postfixadmin
|
||||
* Ed Wildgoose for fixing possible SQL injection vulnerability
|
||||
|
18
user_sql.php
18
user_sql.php
@ -122,6 +122,8 @@ class OC_USER_SQL extends OC_User_Backend implements OC_User_Interface {
|
||||
OC_Log::write('OC_USER_SQL', "Executing query...", OC_Log::DEBUG);
|
||||
if(!$result->execute())
|
||||
{
|
||||
$err = $result->errorInfo();
|
||||
OC_Log::write('OC_USER_SQL', "Query failed: ".$err[2], OC_Log::DEBUG);
|
||||
OC_Log::write('OC_USER_SQL', "Could not update password!", OC_Log::ERROR);
|
||||
return false;
|
||||
}
|
||||
@ -159,6 +161,8 @@ class OC_USER_SQL extends OC_User_Backend implements OC_User_Interface {
|
||||
OC_Log::write('OC_USER_SQL', "Executing query...", OC_Log::DEBUG);
|
||||
if(!$result->execute())
|
||||
{
|
||||
$err = $result->errorInfo();
|
||||
OC_Log::write('OC_USER_SQL', "Query failed: ".$err[2], OC_Log::DEBUG);
|
||||
return false;
|
||||
}
|
||||
OC_Log::write('OC_USER_SQL', "Fetching row...", OC_Log::DEBUG);
|
||||
@ -208,23 +212,21 @@ class OC_USER_SQL extends OC_User_Backend implements OC_User_Interface {
|
||||
$query .= " $this->sql_column_active = 1";
|
||||
}
|
||||
if($limit != null)
|
||||
$query .= " LIMIT :limit";
|
||||
$query .= " LIMIT $limit";
|
||||
if($offset != null)
|
||||
$query .= " OFFSET :offset";
|
||||
$query .= " OFFSET $offset";
|
||||
OC_Log::write('OC_USER_SQL', "Preparing query: $query", OC_Log::DEBUG);
|
||||
$result = $this->db->prepare($query);
|
||||
if($search != '')
|
||||
$result->bindParam(":search", "%$search%");
|
||||
if($limit != null)
|
||||
$result->bindParam(":limit", $limit);
|
||||
if($offset != null)
|
||||
$result->bindParam(":offset", $offset);
|
||||
OC_Log::write('OC_USER_SQL', "Executing query...", OC_Log::DEBUG);
|
||||
if(!$result->execute())
|
||||
{
|
||||
$err = $result->errorInfo();
|
||||
OC_Log::write('OC_USER_SQL', "Query failed: ".$err[2], OC_Log::DEBUG);
|
||||
return array();
|
||||
}
|
||||
OC_Log::write('OC_USER_SQL', "Fetchin results...", OC_Log::DEBUG);
|
||||
OC_Log::write('OC_USER_SQL', "Fetching results...", OC_Log::DEBUG);
|
||||
while($row = $result->fetch())
|
||||
{
|
||||
$uid = $row[$this->sql_column_username];
|
||||
@ -267,6 +269,8 @@ class OC_USER_SQL extends OC_User_Backend implements OC_User_Interface {
|
||||
OC_Log::write('OC_USER_SQL', "Executing query...", OC_Log::DEBUG);
|
||||
if(!$result->execute())
|
||||
{
|
||||
$err = $result->errorInfo();
|
||||
OC_Log::write('OC_USER_SQL', "Query failed: ".$err[2], OC_Log::DEBUG);
|
||||
return false;
|
||||
}
|
||||
OC_Log::write('OC_USER_SQL', "Fetching results...", OC_Log::DEBUG);
|
||||
|
Loading…
Reference in New Issue
Block a user