Current time: 11-24-2024, 04:46 AM Hello There, Guest! (LoginRegister)


Post Reply 
[HowTo] Password Changer Roundcube 0.3 Stable
Author Message
remontti Offline


Posts: 1
Joined: Mar 2010
Reputation: 0
Post: #47
RE: [HowTo] Password Changer Roundcube 0.3 Stable
pt_BR Apanhei um monte no ISP 1.0.4, consegui com q funcionasse da seguinte formar, alterando o sql.php em /var/www/ispcp/gui/tools/roundcube/plugins/ispcp_pw_changer/drivers para :

En Tongue
I got a lot in the ISP 1.0.4, get with q works like this, changing the sql.php in / var / www / ispCP / gui / tools / roundcube / plugins / ispcp_pw_changer / drivers for:




Code:
<?php

/**
* SQL Password Driver
*
* Driver for passwords stored in ispCP database
*
* @version 1.0
* @author Sascha alias TheCry
*
*/

function password_save($passwd)
{
    $rcmail = rcmail::get_instance();
    $sql = "UPDATE `mail_users` SET `mail_pass` = %p, status = 'change' WHERE `mail_addr` = %u LIMIT 1";

    if ($dsn = $rcmail->config->get('password_db_dsn')) {
// #1486067: enable new_link option
if (is_array($dsn) && empty($dsn['new_link']))
$dsn['new_link'] = true;
else if (!is_array($dsn) && !preg_match('/\?new_link=true/', $dsn))
$dsn .= '?new_link=true';

        $db = new rcube_mdb2($dsn, '', FALSE);
        $db->set_debug((bool)$rcmail->config->get('sql_debug'));
        $db->db_connect('w');
    }
    if ($err = $db->is_error())
        return PASSWORD_ERROR;

    $sql = str_replace('%u', $db->quote($_SESSION['username'],'text'), $sql);
    $sql = str_replace('%p', $db->quote($passwd,'text'), $sql);

    $res = $db->query($sql);

    if (!$db->is_error()) {
     if ($db->affected_rows($res) == 1)
require('../../include/ispcp-functions.php');
send_request();
return PASSWORD_SUCCESS; // This is the good case: 1 row updated
    }

    return PASSWORD_ERROR;
}

?>

TheCry (author)
http://github.com/TheCry/ispCP-roundcube...rs/sql.php
03-06-2010 03:38 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [HowTo] Password Changer Roundcube 0.3 Stable - remontti - 03-06-2010 03:38 AM

Forum Jump:


User(s) browsing this thread: 11 Guest(s)