this is the diff

there is still the problem with access to the "vpopmail.mysql", I think
it ca be arranged with a link

Regards
Lucian

Jake Vickers wrote:
> Lucian Cristian wrote:
>> if you search in your mails around 03-04.11.2007  :) I told you that
>> "vpopmail.mysql is not readable by apache user because /home/vpopmail
>> doesn't permit it, how should we approach this ? "
>>
>> and I sent you the admin.inc.php (no diff)
>>
>> I think it was somewhere at:
>>
>> function read_qmail_sql() {
>>
>>     $fd = fopen ( "/home/vpopmail/etc/vpopmail.mysql", "r" ) ;
>>
>> the path wasn't good,
>>
>> sorry for now I don't have access to make a diff
>>
>>   
>
> I do see the email (and still haven't read it in-depth) - I had just
> gotten my son home from the hospital, so he was only about a week old
> and nobody was sleeping more than 90 minutes at a time here....
> I'm not in front of any QMT machines at the moment to check - was this
> a rewritten admin.inc.php, or did you just change a function in it?
>
>
> ---------------------------------------------------------------------
>     QmailToaster hosted by: VR Hosted <http://www.vr.org>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com
> For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com
>

--- admin.inc.php       2008-12-16 22:18:32.000000000 +0200
+++ admin.new   2008-12-16 23:03:05.000000000 +0200
@@ -7,7 +7,7 @@
 function read_file($file) {

        if ( is_readable ( $file ) ) {
-               $fd = fopen ( $file, r ) ;
+               $fd = fopen ( $file, 'r' ) ;
                $contents = fread ( $fd, filesize( $file ) ) ;
                fclose ( $fd ) ;
                $contents = ereg_replace("\n", "", $contents ) ;
@@ -22,7 +22,7 @@
 function write_file($contents="", $file) {

        if ( is_writable ( $file ) && strlen( $contents ) >= 1 ) {
-               $fd = fopen ( $file, w ) ;
+               $fd = fopen ( $file, 'w' ) ;
                fwrite ( $fd, $contents ) ;
                fclose ( $fd ) ;
                return true ;
@@ -134,7 +134,7 @@

                if ( substr ( $file, -7 ) == ".module" ) {

-                       $fd     = fopen ( $file, r ) ;
+                       $fd     = fopen ( $file, 'r' ) ;
                        $html  .= fread ( $fd, filesize ( $file ) ) ;
                        fclose ( $fd ) ;

@@ -175,7 +175,7 @@

        $result = mysql_query ( "select pw_name from " . $domains[$i] ) ;

-       while ( $user = mysql_fetch_array ( $result ) ) {
+       while ( $user = @mysql_fetch_array ( $result ) ) {

                $users[] = $user[0] . "@" . str_replace ("_", ".", $domains[$i] 
) ;

@@ -260,13 +260,24 @@

 function read_qmail_sql() {

-       $fd = popen ( BASEDIR . "/include/sql.sh", "r" ) ;
+       $fd = fopen ( "/home/vpopmail/etc/vpopmail.mysql", "r" ) ;
        $contents = fread ( $fd, 1024 ) ;
        pclose ( $fd ) ;

-       $line = explode ( "\n", str_replace ( "\r", "", $contents ) ) ;
+       $line_ = explode ( "\n", str_replace ( "\r", "", $contents ) ) ;
+       $line = explode ( "|", str_replace ( "\r", "", $line_[0] ) ) ;

-       for ( $i = 0; $i < sizeof ( $line ); $i++ ) {
+       if ( sizeof( $line) == 5 ) {
+               $host = $line[0];
+               $port = $line[1];
+               $database = $line[2];
+               $pass = $line[3];
+               $user = $line[4];
+               return array ("host"=>$host, "port"=>$port, 
"database"=>$database, "user"=>$user, "pass"=>$pass ) ;
+       } else {
+               return false ;
+       }
+       /* for ( $i = 0; $i < sizeof ( $line ); $i++ ) {

                // We use substr instead of eregi...
                // ... so user can be called user and password maybe called 
password
@@ -292,8 +303,8 @@

                return false ;

-       }
-
+       } */
 }

 ?>
+

---------------------------------------------------------------------
     QmailToaster hosted by: VR Hosted <http://www.vr.org>
---------------------------------------------------------------------
To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com
For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com

Reply via email to