Member
Member
Jason   2007-03-19, 13:13
#1

Our gallery needed multiple administrators, and we each didn't want to share each others credentials (it's very insecure).

So I modified a few files, the mods are below.

zp-config.php
[Add the following lines after old admin data]


$conf['admins'][] = array( 'username' => 'YOUR_USER', 'password' => 'YOUR_PASSWORD' );
$conf['admins'][] = array( 'username' => 'YOUR_USER2', 'password' => 'YOUR_PASSWORD2' );
[Repeat until you are satisfied]


auth_zp.php
[Add to top of file (after $_zp_loggedin = false)]


$security_key = "1337-trisweb-r0x|";
// (Replace the security key with a personal random phrase)


  1. [Replace]


    if ($user == zp_conf("adminuser") && $pass == zp_conf("adminpass")) {
    // Correct auth info. Set the cookie.
    setcookie("zenphoto_auth", md5($user.$pass), time()+5184000, $cookiepath);
    $_zp_loggedin = true;
    //// FIXME: Breaks IIS
    if (!empty($redirect)) { header("Location: " . FULLWEBPATH . $redirect); }
    ////
    } else {
    // Clear the cookie, just in case
    setcookie("zenphoto_auth", "", time()-368000, $cookiepath);
    $error = true;
    }


    [With this]


    $found = 0;
    for( &#36;i = 0; &#36;i < count( &#36;conf['admins'] ); &#36;i++ )
    {
    if( &#36;conf['admins'][&#36;i]['username'] == &#36;user && &#36;conf['admins'][&#36;i]['password'] == &#36;pass )
    {
    // Correct auth info. Set the cookie.
    setcookie("zenphoto_auth", md5(&#36;security_key), time()+5184000, &#36;cookiepath);
    &#36;_zp_loggedin = true;
    //// FIXME: Breaks IIS
    if (!empty(&#36;redirect)) { header("Location: " . FULLWEBPATH . &#36;redirect); }
    ////
    &#36;found = 1;
    }
    }

    if(&#36;found == 0)
    {
    // Clear the cookie, just in case
    setcookie("zenphoto_auth", "", time()-368000, &#36;cookiepath);
    &#36;error = true;
    }


  2. [Replace]


    &#36;check_auth = md5(zp_conf("adminuser").zp_conf("adminpass"));


    [With this]


    &#36;check_auth = md5(&#36;security_key);


Member
Member
Jason   2007-03-19, 13:14
#2

I hope someone finds this usefull ^^

Member
Member
flick   2007-05-02, 18:30
#3

Does this work for 1.0.8.2 as well? Thanks!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.