From 65232cdf0ac50015997f4991823c9ba4a5f8b1c3 Mon Sep 17 00:00:00 2001 From: Michael Joseph Date: Wed, 8 Jan 2003 13:34:50 +0000 Subject: [PATCH] converted tabs to spaces --- lib/owl.lib.php | 1610 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 file changed, 805 insertions(+), 805 deletions(-) diff --git a/lib/owl.lib.php b/lib/owl.lib.php index 741296e..2b8a573 100755 --- a/lib/owl.lib.php +++ b/lib/owl.lib.php @@ -23,152 +23,152 @@ */ class Owl_DB extends DB_Sql { - - /** Class name */ + + /** Class name */ var $classname = "Owl_DB"; // BEGIN wes changes -- moved these settings to config/owl.php // Server where the database resides - - /** Host name. Retrieved from config/owl.php */ + + /** Host name. Retrieved from config/owl.php */ var $Host = ""; /** Database name */ var $Database = ""; /** Database user */ var $User = ""; /** Database user password */ - var $Password = ""; - /** Query to execute */ - var $sQuery; - /** Name of table last query was executed on*/ - var $sLastTableName; - /** Where clause last used in query execution */ - var $sLastWhereClause; - /** Order by clause last used in query execution */ - var $sLastOrderByClause; - - /** Default Constructor */ - function Owl_DB() { - global $default; - $this->Host = $default->owl_db_host; - $this->Database = $default->owl_db_name; - $this->User = $default->owl_db_user; - $this->Password = $default->owl_db_pass; - } - // END wes changes - - /** - * Create a query from the provided paramaters. The ID column - * is seleted by default - * - * @param $sTableName Table to query - * @param $aColumns Columns in table - * @param $sWhereClause Where clause (optional) - * @param $sOrderByClause Order by clause (optional) - */ - function createSQLQuery($sTableName, $aColumns, $sWhereClause = null, $sOrderByClause = null) { - $this->sLastTableName = $sTableName; - $this->sLastWhereCluase = $sWhereClause; - $this->sLastOrderByClause = $sOrderByClause; - - $this->sQuery = "SELECT ID, "; - - for( $i = 0; $i < count($aColumns) - 1; $i++ ) { - $this->sQuery = $this->sQuery . $aColumns[$i] . ","; - } - - $this->sQuery .= $aColumns[count($aColumns) - 1] . " "; - $this->sQuery .= "FROM " . $sTableName . " "; - - if (isset($sWhereClause)) { - $this->sQuery .= "WHERE " . $sWhereClause . " "; - } - - if (isset($sOrderByClause)) { - $this->sQuery .= "ORDER BY " . $sOrderByClause . " "; - } - - } - - /** - Create a query from the provided paramaters, specifying a limit and an offset. - The ID column is selected by default - - @param $sTableName Table to query - @param $aColumns Columns in table - @param $iOffset Offset - @param $iLimit Limit - @param $sWhereClause Where clause (optional) - @param $sOrderByClause Order by clause (optional) - */ - - function createSQLQueryWithOffset($sTableName, $aColumns, $iOffset, $iLimit, $sWhereClause = null, $sOrderByClause = null) { - $this->sLastTableName = $sTableName; - $this->sLastWhereCluase = $sWhereClause; - $this->sLastOrderByClause = $sOrderByClause; - - $this->sQuery = "SELECT ID, "; - - for( $i = 0; $i < count($aColumns) - 1; $i++ ) { - $this->sQuery = $this->sQuery . $aColumns[$i] . ","; - } - - $this->sQuery .= $aColumns[count($aColumns) - 1] . " "; - $this->sQuery .= "FROM " . $sTableName . " "; - - - - if (isset($sWhereClause)) { - $this->sQuery .= "WHERE " . $sWhereClause . " "; - } - - if (isset($sOrderByClause)) { - $this->sQuery .= "ORDER BY " . $sOrderByClause . " "; - } - - $this->sQuery .= "LIMIT " . $iOffset . ", " . $iLimit; - } - - /** - * Get the result count for the previously executed query. Meant - * to be used in conjuction with createSSQLQueryWithOffset so that - * the total number of results can be calculated - * - * @return int row count - */ - function & getLastQueryResultCount() { - if (isset($this->sLastTableName)) { - $sCountResultQuery = "SELECT COUNT(*) AS ResultCount FROM " . $this->sLastTableName; - - if (isset($this->sLastWhereClause)) { - sCountResultQuery . " WHERE " . $this->sLastWhereClause; - } - $this->query($sCountResultQuery); - $this->next_record(); - return $this->f("ResultCount"); - } else { - return 0; - } - } - - /** - * Execute the query and return the results - * - * @returns Results of query - */ - function & getQueryResults() { - $result = null; - if (isset($this->sQuery)) { - $result = $this->query($this->sQuery); - } - return $result; - } - + var $Password = ""; + /** Query to execute */ + var $sQuery; + /** Name of table last query was executed on*/ + var $sLastTableName; + /** Where clause last used in query execution */ + var $sLastWhereClause; + /** Order by clause last used in query execution */ + var $sLastOrderByClause; + + /** Default Constructor */ + function Owl_DB() { + global $default; + $this->Host = $default->owl_db_host; + $this->Database = $default->owl_db_name; + $this->User = $default->owl_db_user; + $this->Password = $default->owl_db_pass; + } + // END wes changes + + /** + * Create a query from the provided paramaters. The ID column + * is seleted by default + * + * @param $sTableName Table to query + * @param $aColumns Columns in table + * @param $sWhereClause Where clause (optional) + * @param $sOrderByClause Order by clause (optional) + */ + function createSQLQuery($sTableName, $aColumns, $sWhereClause = null, $sOrderByClause = null) { + $this->sLastTableName = $sTableName; + $this->sLastWhereCluase = $sWhereClause; + $this->sLastOrderByClause = $sOrderByClause; + + $this->sQuery = "SELECT ID, "; + + for( $i = 0; $i < count($aColumns) - 1; $i++ ) { + $this->sQuery = $this->sQuery . $aColumns[$i] . ","; + } + + $this->sQuery .= $aColumns[count($aColumns) - 1] . " "; + $this->sQuery .= "FROM " . $sTableName . " "; + + if (isset($sWhereClause)) { + $this->sQuery .= "WHERE " . $sWhereClause . " "; + } + + if (isset($sOrderByClause)) { + $this->sQuery .= "ORDER BY " . $sOrderByClause . " "; + } + + } + + /** + Create a query from the provided paramaters, specifying a limit and an offset. + The ID column is selected by default + + @param $sTableName Table to query + @param $aColumns Columns in table + @param $iOffset Offset + @param $iLimit Limit + @param $sWhereClause Where clause (optional) + @param $sOrderByClause Order by clause (optional) + */ + + function createSQLQueryWithOffset($sTableName, $aColumns, $iOffset, $iLimit, $sWhereClause = null, $sOrderByClause = null) { + $this->sLastTableName = $sTableName; + $this->sLastWhereCluase = $sWhereClause; + $this->sLastOrderByClause = $sOrderByClause; + + $this->sQuery = "SELECT ID, "; + + for( $i = 0; $i < count($aColumns) - 1; $i++ ) { + $this->sQuery = $this->sQuery . $aColumns[$i] . ","; + } + + $this->sQuery .= $aColumns[count($aColumns) - 1] . " "; + $this->sQuery .= "FROM " . $sTableName . " "; + + + + if (isset($sWhereClause)) { + $this->sQuery .= "WHERE " . $sWhereClause . " "; + } + + if (isset($sOrderByClause)) { + $this->sQuery .= "ORDER BY " . $sOrderByClause . " "; + } + + $this->sQuery .= "LIMIT " . $iOffset . ", " . $iLimit; + } + + /** + * Get the result count for the previously executed query. Meant + * to be used in conjuction with createSSQLQueryWithOffset so that + * the total number of results can be calculated + * + * @return int row count + */ + function & getLastQueryResultCount() { + if (isset($this->sLastTableName)) { + $sCountResultQuery = "SELECT COUNT(*) AS ResultCount FROM " . $this->sLastTableName; + + if (isset($this->sLastWhereClause)) { + sCountResultQuery . " WHERE " . $this->sLastWhereClause; + } + $this->query($sCountResultQuery); + $this->next_record(); + return $this->f("ResultCount"); + } else { + return 0; + } + } + + /** + * Execute the query and return the results + * + * @returns Results of query + */ + function & getQueryResults() { + $result = null; + if (isset($this->sQuery)) { + $result = $this->query($this->sQuery); + } + return $result; + } + /** * Display any database errors encountered */ function haltmsg($msg) { - printf("Database error: %s
\n", $msg); + printf("Database error: %s
\n", $msg); printf("SQL Error: %s (%s)
\n",$this->Errno, $this->Error); } } @@ -183,9 +183,9 @@ class Owl_DB extends DB_Sql { * @package Owl */ class Owl_Session { - var $sessid; - var $sessuid; - var $sessdata; + var $sessid; + var $sessuid; + var $sessdata; //------------------------------------------------------------ /** @@ -194,30 +194,30 @@ class Owl_Session { * Opens a session * * @param $sessid - * The Session id + * The Session id * @param ssessuid - * The user session id + * The user session id * @Return $this - * Return the session + * Return the session * */ //------------------------------------------------------------ // Usable - function Open_Session($sessid=0, $sessuid=0) { + function Open_Session($sessid=0, $sessuid=0) { global $default; - $this->sessid = $sessid; - $this->sessuid = $sessuid; - - // if there is no user loged in, then create a session for them - if($sessid == "0") - { - $current = time(); - $random = $this->sessuid . $current; - $this->sessid = md5($random); - $sql = new Owl_DB; - - if(getenv("HTTP_CLIENT_IP")) - { + $this->sessid = $sessid; + $this->sessuid = $sessuid; + + // if there is no user loged in, then create a session for them + if($sessid == "0") + { + $current = time(); + $random = $this->sessuid . $current; + $this->sessid = md5($random); + $sql = new Owl_DB; + + if(getenv("HTTP_CLIENT_IP")) + { $ip = getenv("HTTP_CLIENT_IP"); } elseif(getenv("HTTP_X_FORWARDED_FOR")) @@ -229,29 +229,29 @@ class Owl_Session { { $ip = getenv("REMOTE_ADDR"); } - //$result = $sql->query("insert into active_sessions values ('$this->sessid', '$this->sessuid', '$current', '$ip')"); - $result = $sql->query("insert into $default->owl_sessions_table values ('$this->sessid', '$this->sessuid', '$current', '$ip')"); - - if(!'result') - { - die("$lang_err_sess_write"); - } - } - - // else we have a session id, try to validate it... - $sql = new Owl_DB; - $sql->query("select * from $default->owl_sessions_table where sessid = '$this->sessid'"); - - // any matching session ids? - $numrows = $sql->num_rows($sql); - if(!$numrows) die("$lang_err_sess_notvalid"); - - // return if we are a.o.k. - while($sql->next_record()) { - $this->sessdata["sessid"] = $sql->f("sessid"); - } - return $this; - } + //$result = $sql->query("insert into active_sessions values ('$this->sessid', '$this->sessuid', '$current', '$ip')"); + $result = $sql->query("insert into $default->owl_sessions_table values ('$this->sessid', '$this->sessuid', '$current', '$ip')"); + + if(!'result') + { + die("$lang_err_sess_write"); + } + } + + // else we have a session id, try to validate it... + $sql = new Owl_DB; + $sql->query("select * from $default->owl_sessions_table where sessid = '$this->sessid'"); + + // any matching session ids? + $numrows = $sql->num_rows($sql); + if(!$numrows) die("$lang_err_sess_notvalid"); + + // return if we are a.o.k. + while($sql->next_record()) { + $this->sessdata["sessid"] = $sql->f("sessid"); + } + return $this; + } } @@ -262,19 +262,19 @@ class Owl_Session { * Used to notify users * * @param $groupid - * The Id of the group + * The Id of the group * @param $flag - * The relvant flag + * The relvant flag * @param $filename - * The relevant filename + * The relevant filename * @param $title - * The relevant title + * The relevant title * @param $desc - * The description + * The description * @param $type - * the Relevant type + * the Relevant type */ -//------------------------------------------------------------- +//------------------------------------------------------------- // Semi-Usable Some Interface based code function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) { @@ -285,9 +285,9 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) // BEGIN BUG 548994 // get the fileid $path = find_path($parent); - $sql->query("select id from $default->owl_files_table where filename='$filename' AND parent='$parent'"); - $sql->next_record(); - $fileid = $sql->f("id"); + $sql->query("select id from $default->owl_files_table where filename='$filename' AND parent='$parent'"); + $sql->next_record(); + $fileid = $sql->f("id"); // END BUG 548994 More Below $sql->query("select distinct id, email,language,attachfile from $default->owl_users_table as u, $default->owl_users_grpmem_table as m where notify = 1 and (u.groupid = $groupid or m.groupid = $groupid)"); @@ -295,112 +295,112 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) while($sql->next_record()) { // BEGIN BUG 548994 - // check authentication rights - if ( check_auth($fileid, "file_download", $sql->f(id)) == 1 ) - { + // check authentication rights + if ( check_auth($fileid, "file_download", $sql->f(id)) == 1 ) + { // END BUG 548994 More Below - $newpath = ereg_replace(" ","%20",$path); - $newfilename = ereg_replace(" ","%20",$filename); - $DefUserLang = $sql->f("language"); - require("$default->owl_fs_root/locale/$DefUserLang/language.inc"); - - $r=preg_split("(\;|\,)",$sql->f("email")); - reset ($r); - while (list ($occ, $email) = each ($r)) - { - $mail = new phpmailer(); - // Create a temporary session id, the user - // will need to get to this file before - // the default session timeout - $session = new Owl_Session; - $uid = $session->Open_Session(0,$sql->f("id")); + $newpath = ereg_replace(" ","%20",$path); + $newfilename = ereg_replace(" ","%20",$filename); + $DefUserLang = $sql->f("language"); + require("$default->owl_fs_root/locale/$DefUserLang/language.inc"); + + $r=preg_split("(\;|\,)",$sql->f("email")); + reset ($r); + while (list ($occ, $email) = each ($r)) + { + $mail = new phpmailer(); + // Create a temporary session id, the user + // will need to get to this file before + // the default session timeout + $session = new Owl_Session; + $uid = $session->Open_Session(0,$sql->f("id")); $tempsess = $uid->sessdata["sessid"]; - - // if flag set to 0 - if ( $flag == 0 ) { - $mail->IsSMTP(); // set mailer to use SMTP - $mail->Host = "$default->owl_email_server"; // specify main and backup server - $mail->From = "$default->owl_email_from"; - $mail->FromName = "$default->owl_email_fromname"; - $mail->AddAddress($email); - $mail->AddReplyTo("$default->owl_email_replyto", "OWL Intranet"); - $mail->WordWrap = 50; // set word wrap to 50 characters - $mail->IsHTML(true); // set email format to HTML - $mail->Subject = "$lang_notif_subject_new"; - - // as long as its not a url - if ($type != "url") - { - // if attachfile is true + + // if flag set to 0 + if ( $flag == 0 ) { + $mail->IsSMTP(); // set mailer to use SMTP + $mail->Host = "$default->owl_email_server"; // specify main and backup server + $mail->From = "$default->owl_email_from"; + $mail->FromName = "$default->owl_email_fromname"; + $mail->AddAddress($email); + $mail->AddReplyTo("$default->owl_email_replyto", "OWL Intranet"); + $mail->WordWrap = 50; // set word wrap to 50 characters + $mail->IsHTML(true); // set email format to HTML + $mail->Subject = "$lang_notif_subject_new"; + + // as long as its not a url + if ($type != "url") + { + // if attachfile is true if ($sql->f("attachfile") == 1) { $mail->Body = "$lang_notif_msg

" . "$lang_title: $title" . "

$lang_description: $desc"; - $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc"; - - // use file system - if (!$default->owl_use_fs) - { - //check if file exits - if (file_exists("$default->owl_FileDir/$filename")) - { - unlink("$default->owl_FileDir/$filename"); - } - $file = fopen("$default->owl_FileDir$filename", 'wb'); - $getfile = new Owl_DB; - $getfile->query("select data,compressed from $default->owl_files_data_table where id='$fileid'"); - while ($getfile->next_record()) - { - //check if compressed ..and uncompress it - if ($getfile->f("compressed")) { - - $tmpfile = $default->owl_FileDir . "owltmp.$fileid.gz"; - $uncomptmpfile = $default->owl_FileDir . "owltmp.$fileid"; - if (file_exists($tmpfile)) unlink($tmpfile); - - $fp=fopen($tmpfile,"w"); - fwrite($fp, $getfile->f("data")); - fclose($fp); - - system($default->gzip_path . " -df $tmpfile"); - - $fsize = filesize($uncomptmpfile); - $fd = fopen($uncomptmpfile, 'rb'); - $filedata = fread($fd, $fsize); - fclose($fd); - - fwrite($file, $filedata); - unlink($uncomptmpfile); - } - else - { // otherwise just write the file - fwrite($file, $getfile->f("data")); - } - } - fclose($file); - // add a mail attachment - $mail->AddAttachment("$default->owl_FileDir$newfilename"); - } else - { - $mail->AddAttachment("$default->owl_FileDir/$newpath/$newfilename"); - } + $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc"; + + // use file system + if (!$default->owl_use_fs) + { + //check if file exits + if (file_exists("$default->owl_FileDir/$filename")) + { + unlink("$default->owl_FileDir/$filename"); + } + $file = fopen("$default->owl_FileDir$filename", 'wb'); + $getfile = new Owl_DB; + $getfile->query("select data,compressed from $default->owl_files_data_table where id='$fileid'"); + while ($getfile->next_record()) + { + //check if compressed ..and uncompress it + if ($getfile->f("compressed")) { + + $tmpfile = $default->owl_FileDir . "owltmp.$fileid.gz"; + $uncomptmpfile = $default->owl_FileDir . "owltmp.$fileid"; + if (file_exists($tmpfile)) unlink($tmpfile); + + $fp=fopen($tmpfile,"w"); + fwrite($fp, $getfile->f("data")); + fclose($fp); + + system($default->gzip_path . " -df $tmpfile"); + + $fsize = filesize($uncomptmpfile); + $fd = fopen($uncomptmpfile, 'rb'); + $filedata = fread($fd, $fsize); + fclose($fd); + + fwrite($file, $filedata); + unlink($uncomptmpfile); + } + else + { // otherwise just write the file + fwrite($file, $getfile->f("data")); + } + } + fclose($file); + // add a mail attachment + $mail->AddAttachment("$default->owl_FileDir$newfilename"); + } else + { + $mail->AddAttachment("$default->owl_FileDir/$newpath/$newfilename"); + } } else - { // set up mail body + { // set up mail body $mail->Body = "$lang_notif_msg

" . "$lang_title: $title" . "

URL: $default->owl_notify_link" . "browse.php?sess=$tempsess&parent=$parent&expand=1&fileid=$fileid" . "

$lang_description: $desc"; - $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc"; + $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc"; } - } - else - { - $mail->Body = "URL: $newfilename

$lang_notif_msg

" . "$lang_title: $title" . "

$lang_description: $desc"; - $mail->altBody = "URL: $newfilename \n\n$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc"; - } - - } - else - // set up mailer - { - $mail = new phpmailer(); + } + else + { + $mail->Body = "URL: $newfilename

$lang_notif_msg

" . "$lang_title: $title" . "

$lang_description: $desc"; + $mail->altBody = "URL: $newfilename \n\n$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc"; + } + + } + else + // set up mailer + { + $mail = new phpmailer(); $mail->IsSMTP(); // set mailer to use SMTP $mail->Host = "$default->owl_email_server"; // specify main and backup server $mail->From = "$default->owl_email_from"; @@ -409,19 +409,19 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) $mail->AddReplyTo("$default->owl_email_replyto", "OWL Intranet"); $mail->WordWrap = 50; // set word wrap to 50 characters $mail->IsHTML(true); // set email format to HTML - $mail->Subject = "$lang_notif_subject_upd"; + $mail->Subject = "$lang_notif_subject_upd"; - // if type not a url + // if type not a url if ($type != "url") { - // if attachfile is true..go through process of attaching file..simarly to previous + // if attachfile is true..go through process of attaching file..simarly to previous if ($sql->f("attachfile") == 1) { $mail->Body = "$lang_notif_msg

" . "$lang_title: $title" . "

$lang_description: $desc"; $mail->altBody = "$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc"; - if (!$default->owl_use_fs) - { - // check existence of file + if (!$default->owl_use_fs) + { + // check existence of file if (file_exists("$default->owl_FileDir/$filename")) { unlink("$default->owl_FileDir/$filename"); @@ -480,18 +480,18 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) $mail->Body = "URL: $newfilename

$lang_notif_msg

" . "$lang_title: $title" . "

$lang_description: $desc"; $mail->altBody = "URL: $newfilename \n\n$lang_notif_msg\n\n" . "$lang_title: $title" . "\n\n $lang_description: $desc"; } - } - // send the email - $mail->Send(); - if (!$default->owl_use_fs && $sql->f("attachfile") == 1) - { - unlink("$default->owl_FileDir$newfilename"); - } - + } + // send the email + $mail->Send(); + if (!$default->owl_use_fs && $sql->f("attachfile") == 1) + { + unlink("$default->owl_FileDir$newfilename"); + } + } } // BEGIN BUG 548994 - } + } // END BUG 548994 } @@ -502,29 +502,29 @@ function notify_users($groupid, $flag, $parent, $filename, $title, $desc, $type) * Used to verify a users login name and password * * @param $username - * The username to verfiy + * The username to verfiy * @param $password - * The password to verify + * The password to verify */ //------------------------------------------------------------- // Usable function verify_login($username, $password) { - global $default; - $sql = new Owl_DB; - $query = "select * from $default->owl_users_table where username = '$username' and password = '" . md5($password) . "'"; - $sql->query("select * from $default->owl_users_table where username = '$username' and password = '" . md5($password) . "'"); - $numrows = $sql->num_rows($sql); + global $default; + $sql = new Owl_DB; + $query = "select * from $default->owl_users_table where username = '$username' and password = '" . md5($password) . "'"; + $sql->query("select * from $default->owl_users_table where username = '$username' and password = '" . md5($password) . "'"); + $numrows = $sql->num_rows($sql); // Bozz Begin added Password Encryption above, but for now // I will allow admin to use non crypted password untile he // upgrades all users - if ($numrows == "1") - { - while($sql->next_record()) { + if ($numrows == "1") + { + while($sql->next_record()) { if ( $sql->f("disabled") == 1 ) - $verified["bit"] = 2; + $verified["bit"] = 2; else - $verified["bit"] = 1; + $verified["bit"] = 1; $verified["user"] = $sql->f("username"); $verified["uid"] = $sql->f("id"); $verified["group"] = $sql->f("groupid"); @@ -533,10 +533,10 @@ function verify_login($username, $password) } // Remove this else in a future version else { - // username admin check password + // username admin check password if ($username == "admin") { - $sql->query("select * from $default->owl_users_table where username = '$username' and password = '$password'"); + $sql->query("select * from $default->owl_users_table where username = '$username' and password = '$password'"); $numrows = $sql->num_rows($sql); if ($numrows == "1") { @@ -564,13 +564,13 @@ function verify_login($username, $password) $sql = new Owl_DB; $sql->query("select * from $default->owl_sessions_table where uid = '".$verified["uid"]."'"); - if ($sql->num_rows($sql) >= $maxsessions && $verified["bit"] != 0) { + if ($sql->num_rows($sql) >= $maxsessions && $verified["bit"] != 0) { if ( $verified["group"] == 0) - $verified["bit"] = 1; + $verified["bit"] = 1; else - $verified["bit"] = 3; - } - return $verified; + $verified["bit"] = 3; + } + return $verified; } //------------------------------------------------------------ @@ -580,82 +580,82 @@ function verify_login($username, $password) * Used to verify a users session * * @param $username - * The username to check + * The username to check * @param $password - * The password to check + * The password to check */ //------------------------------------------------------------- // Usable function verify_session($sess) { getprefs(); - global $default, $lang_sesstimeout, $lang_sessinuse, $lang_clicklogin; + global $default, $lang_sesstimeout, $lang_sessinuse, $lang_clicklogin; $sess = ltrim($sess); - $verified["bit"] = 0; - - $sql = new Owl_DB; + $verified["bit"] = 0; + + $sql = new Owl_DB; $sql->query("select * from $default->owl_sessions_table where sessid = '$sess'"); - $numrows = $sql->num_rows($sql); - $time = time(); - - if ($numrows == "1") - { - while($sql->next_record()) - { - if(getenv("HTTP_CLIENT_IP")) - { - $ip = getenv("HTTP_CLIENT_IP"); - } - elseif(getenv("HTTP_X_FORWARDED_FOR")) - { - $forwardedip = getenv("HTTP_X_FORWARDED_FOR"); - list($ip,$ip2,$ip3,$ip4)= split (",", $forwardedip); - } - else - { - $ip = getenv("REMOTE_ADDR"); - } - if ($ip == $sql->f("ip")) - { - // if timeout not exceeded - if(($time - $sql->f("lastused")) <= $default->owl_timeout) - { - $verified["bit"] = 1; - $verified["userid"] = $sql->f("uid"); - $sql->query("select * from $default->owl_users_table where id = '".$verified["userid"]."'"); - while($sql->next_record()) $verified["groupid"] = $sql->f("groupid"); - } - else - { + $numrows = $sql->num_rows($sql); + $time = time(); + + if ($numrows == "1") + { + while($sql->next_record()) + { + if(getenv("HTTP_CLIENT_IP")) + { + $ip = getenv("HTTP_CLIENT_IP"); + } + elseif(getenv("HTTP_X_FORWARDED_FOR")) + { + $forwardedip = getenv("HTTP_X_FORWARDED_FOR"); + list($ip,$ip2,$ip3,$ip4)= split (",", $forwardedip); + } + else + { + $ip = getenv("REMOTE_ADDR"); + } + if ($ip == $sql->f("ip")) + { + // if timeout not exceeded + if(($time - $sql->f("lastused")) <= $default->owl_timeout) + { + $verified["bit"] = 1; + $verified["userid"] = $sql->f("uid"); + $sql->query("select * from $default->owl_users_table where id = '".$verified["userid"]."'"); + while($sql->next_record()) $verified["groupid"] = $sql->f("groupid"); + } + else + { // Bozz Bug Fix begin if (file_exists("./lib/header.inc")) { - include("./lib/header.inc"); + include("./lib/header.inc"); } else { include("../lib/header.inc"); } // Bozz Buf Fix End - print("

".$lang_sesstimeout); + print("

".$lang_sesstimeout); if ($parent == "" || $fileid == "") - print(""); + print(""); else - print(""); - exit(); - } - } else { + print(""); + exit(); + } + } else { // Bozz Bug Fix begin if (file_exists("./lib/header.inc")) { - include("./lib/header.inc"); + include("./lib/header.inc"); } else { include("../lib/header.inc"); } // Bozz Bug Fix End - print("

".$lang_sessinuse); - exit; - } - } - } - return $verified; + print("

".$lang_sessinuse); + exit; + } + } + } + return $verified; } //------------------------------------------------------------ @@ -665,21 +665,21 @@ function verify_session($sess) { * used to get the folder name * * @param $parent - * The parent id + * The parent id * @Return $sql->f("name"); - * Return the name of the folder + * Return the name of the folder */ //------------------------------------------------------------- // Usable function fid_to_name($parent) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select name from $default->owl_folders_table where id = $parent"); - while($sql->next_record()) - { - return $sql->f("name"); - } + while($sql->next_record()) + { + return $sql->f("name"); + } } //------------------------------------------------------------ @@ -689,21 +689,21 @@ function fid_to_name($parent) * Gets the filename corresponding to the file id * * @param $id - * The file id + * The file id * @Return $sql->f("name"); - * Return the name of the file + * Return the name of the file */ //------------------------------------------------------------- // Usable function flid_to_name($id) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select name from $default->owl_files_table where id = $id"); - while($sql->next_record()) - { - return $sql->f("name"); - } + while($sql->next_record()) + { + return $sql->f("name"); + } } //------------------------------------------------------------ @@ -713,20 +713,20 @@ function flid_to_name($id) * gets filename based on id * * @param $id - * file id + * file id * @Return $sql->f("name"); - * Return the name of the file + * Return the name of the file */ //------------------------------------------------------------- // Usable function flid_to_filename($id) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select filename from $default->owl_files_table where id = $id"); - while($sql->next_record()) - { - return $sql->f("filename"); - } + while($sql->next_record()) + { + return $sql->f("filename"); + } } //------------------------------------------------------------ /** @@ -735,22 +735,22 @@ function flid_to_filename($id) { * Gets the group id that the user blongs to * * @param $userid - * The user id + * The user id * @Return $groupid - * Return the groupId + * Return the groupId */ //------------------------------------------------------------- // Usable function owlusergroup($userid) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select groupid from $default->owl_users_table where id = '$userid'"); - while($sql->next_record()) - { - $groupid = $sql->f("groupid"); - return $groupid; - } + while($sql->next_record()) + { + $groupid = $sql->f("groupid"); + return $groupid; + } } //------------------------------------------------------------ /** @@ -759,21 +759,21 @@ function owlusergroup($userid) * used to find the file creator * * @param $fileid - * The parent id + * The parent id * @return $filecreator - * Return the creatorid of the file + * Return the creatorid of the file */ //------------------------------------------------------------- // Usable function owlfilecreator($fileid) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select creatorid from ".$default->owl_files_table." where id = '$fileid'"); - while($sql->next_record()) - { - $filecreator = $sql->f("creatorid"); - return $filecreator; - } + while($sql->next_record()) + { + $filecreator = $sql->f("creatorid"); + return $filecreator; + } } //------------------------------------------------------------ /** @@ -782,22 +782,22 @@ function owlfilecreator($fileid) { * Used to get the folder creator * * @param $fileid - * The file id + * The file id * @Return $foldercreator - * Return the creatorid of the folder + * Return the creatorid of the folder */ //------------------------------------------------------------- // Usable function owlfoldercreator($folderid) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select creatorid from ".$default->owl_folders_table." where id = '$folderid'"); - while($sql->next_record()) - { - $foldercreator = $sql->f("creatorid"); - return $foldercreator; - } + while($sql->next_record()) + { + $foldercreator = $sql->f("creatorid"); + return $foldercreator; + } } //------------------------------------------------------------- /** @@ -806,23 +806,23 @@ function owlfoldercreator($folderid) * Used to get the file group id * * @param $fileid - * The file id + * The file id * @Return $filegroup; - * Returns the group id of the file group + * Returns the group id of the file group */ //------------------------------------------------------------- // Usable function owlfilegroup($fileid) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select groupid from $default->owl_files_table where id = '$fileid'"); - while($sql->next_record()) - { - $filegroup = $sql->f("groupid"); - return $filegroup; - } - + while($sql->next_record()) + { + $filegroup = $sql->f("groupid"); + return $filegroup; + } + } //------------------------------------------------------------- /** @@ -831,22 +831,22 @@ function owlfilegroup($fileid) * Used to get the folder group id * * @param $folderid - * The folder id + * The folder id * @Return $foldergroup; - * Returns the group id of the folder group + * Returns the group id of the folder group */ //------------------------------------------------------------- // Usable function owlfoldergroup($folderid) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select groupid from $default->owl_folders_table where id = '$folderid'"); - while($sql->next_record()) - { - $foldergroup = $sql->f("groupid"); - return $foldergroup; - } - + while($sql->next_record()) + { + $foldergroup = $sql->f("groupid"); + return $foldergroup; + } + } //------------------------------------------------------------- /** @@ -855,23 +855,23 @@ function owlfoldergroup($folderid) { * Used to get the folder parent * * @param $folderid - * The folder id + * The folder id * @Return $folderparent - * Returns the folderparent of from the folder + * Returns the folderparent of from the folder */ //------------------------------------------------------------- // Usable function owlfolderparent($folderid) { - global $default; - $sql = new Owl_DB; + global $default; + $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$folderid'"); - while($sql->next_record()) - { - $folderparent = $sql->f("parent"); - return $folderparent; - } - + while($sql->next_record()) + { + $folderparent = $sql->f("parent"); + return $folderparent; + } + } //------------------------------------------------------------- /** @@ -880,22 +880,22 @@ function owlfolderparent($folderid) * Used to get the file parent * * @param $fileid - * The file id + * The file id * @Return $fileparent - * Returns the file parent of from the files + * Returns the file parent of from the files */ //------------------------------------------------------------- // Usable function owlfileparent($fileid) { - global $default; - $sql = new Owl_DB; $sql->query("select parent from $default->owl_files_table where id = '$fileid'"); - while($sql->next_record()) - { - $fileparent = $sql->f("parent"); - - return $fileparent; - } + global $default; + $sql = new Owl_DB; $sql->query("select parent from $default->owl_files_table where id = '$fileid'"); + while($sql->next_record()) + { + $fileparent = $sql->f("parent"); + + return $fileparent; + } } //------------------------------------------------------------ /** @@ -904,26 +904,26 @@ function owlfileparent($fileid) * Used to get the creator of the files * * @param $id - * The id + * The id * @Return $name; - * Return the name of the creator + * Return the name of the creator */ //------------------------------------------------------------- // Usable function fid_to_creator($id) { - global $default; - $sql = new Owl_DB; - $sql->query("select creatorid from ".$default->owl_files_table." where id = '$id'"); - $sql2 = new Owl_DB; - while($sql->next_record()) - { - $creatorid = $sql->f("creatorid"); - $sql2->query("select name from $default->owl_users_table where id = '".$creatorid."'"); - $sql2->next_record(); - $name = $sql2->f("name"); - } - return $name; + global $default; + $sql = new Owl_DB; + $sql->query("select creatorid from ".$default->owl_files_table." where id = '$id'"); + $sql2 = new Owl_DB; + while($sql->next_record()) + { + $creatorid = $sql->f("creatorid"); + $sql2->query("select name from $default->owl_users_table where id = '".$creatorid."'"); + $sql2->next_record(); + $name = $sql2->f("name"); + } + return $name; } //------------------------------------------------------------ /** @@ -932,21 +932,21 @@ function fid_to_creator($id) { * select name from the group * * @param $id - * The id + * The id * @Return $sql->f("name"); - * Return the name of the group + * Return the name of the group */ //------------------------------------------------------------- // Usable function group_to_name($id) { - global $default; - $sql = new Owl_DB; - $sql->query("select name from $default->owl_groups_table where id = '$id'"); - while($sql->next_record()) - { - return $sql->f("name"); - } + global $default; + $sql = new Owl_DB; + $sql->query("select name from $default->owl_groups_table where id = '$id'"); + while($sql->next_record()) + { + return $sql->f("name"); + } } //------------------------------------------------------------ /** @@ -955,26 +955,26 @@ function group_to_name($id) * name from the users * * @param $id - * The id + * The id * @Return $name - * Return the name of the user + * Return the name of the user */ //------------------------------------------------------------- // Usable function uid_to_name($id) { - global $default; - $sql = new Owl_DB; - $sql->query("select name from $default->owl_users_table where id = '$id'"); - while($sql->next_record()) - { - $name = $sql->f("name"); - if ($name == "") - { - $name = "Owl"; - } - return $name; - } + global $default; + $sql = new Owl_DB; + $sql->query("select name from $default->owl_users_table where id = '$id'"); + while($sql->next_record()) + { + $name = $sql->f("name"); + if ($name == "") + { + $name = "Owl"; + } + return $name; + } } //------------------------------------------------------------ /** @@ -983,22 +983,22 @@ function uid_to_name($id) * get the noprefaccess from the users to compare if access granted * * @param $id - * The id + * The id * @Return prefaccess; - * Return the name of the folder + * Return the name of the folder */ //------------------------------------------------------------- // Usable function prefaccess($id) { - global $default; - $prefaccess = 1; - $sql = new Owl_DB; $sql->query("select noprefaccess from $default->owl_users_table where id = '$id'"); - while($sql->next_record()) - { - $prefaccess = !($sql->f("noprefaccess")); - return $prefaccess; - } + global $default; + $prefaccess = 1; + $sql = new Owl_DB; $sql->query("select noprefaccess from $default->owl_users_table where id = '$id'"); + while($sql->next_record()) + { + $prefaccess = !($sql->f("noprefaccess")); + return $prefaccess; + } } //------------------------------------------------------------ /** @@ -1007,28 +1007,28 @@ function prefaccess($id) { * Used to generate a nav bar * * @param $parent - * The parent id + * The parent id * @Return $Navbar - * Return the navbar that has been generated + * Return the navbar that has been generated */ //------------------------------------------------------------- // NOT Usable -> Interface based function gen_navbar($parent) { - global $default; - global $sess, $expand, $sort, $sortorder, $order; - $name = fid_to_name($parent); - $navbar = "$name"; - $new = $parent; - while ($new != "1") - { - $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$new'"); - while($sql->next_record()) $newparentid = $sql->f("parent"); - $name = fid_to_name($newparentid); - $navbar = "$name/" . $navbar; - $new = $newparentid; - } - return $navbar; + global $default; + global $sess, $expand, $sort, $sortorder, $order; + $name = fid_to_name($parent); + $navbar = "$name"; + $new = $parent; + while ($new != "1") + { + $sql = new Owl_DB; $sql->query("select parent from $default->owl_folders_table where id = '$new'"); + while($sql->next_record()) $newparentid = $sql->f("parent"); + $name = fid_to_name($newparentid); + $navbar = "$name/" . $navbar; + $new = $newparentid; + } + return $navbar; } //------------------------------------------------------------ /** @@ -1037,9 +1037,9 @@ function gen_navbar($parent) * Get the directory path from the db * * @param $parent - * The parent id + * The parent id * @Return $Navbar; - * Return the navbar with directory path + * Return the navbar with directory path */ //------------------------------------------------------------- // NOT Usable if used in ocnjunction with navbar @@ -1067,22 +1067,22 @@ function get_dirpath($parent) { * generates the file size * * @param $filesize - * The size of the file + * The size of the file * @Return $file_size; - * Return the rounded off file size + * Return the rounded off file size */ //------------------------------------------------------------- // Usable function gen_filesize($file_size) { - if(ereg("[^0-9]", $file_size)) - { - return $file_size; - } - - if ($file_size >= 1073741824) - { - $file_size = round($file_size / 1073741824 * 100) / 100 . "g"; + if(ereg("[^0-9]", $file_size)) + { + return $file_size; + } + + if ($file_size >= 1073741824) + { + $file_size = round($file_size / 1073741824 * 100) / 100 . "g"; } elseif ($file_size >= 1048576) { @@ -1096,7 +1096,7 @@ function gen_filesize($file_size) { $file_size = $file_size . "b"; } - return $file_size; + return $file_size; } //------------------------------------------------------------ /** @@ -1105,9 +1105,9 @@ function gen_filesize($file_size) * used to upload * * @param $varname - * The parent id + * The parent id * @Return $sql->f("name"); - * Return the name of the folder + * Return the name of the folder */ //------------------------------------------------------------- // Usable @@ -1130,7 +1130,7 @@ function uploadCompat($varname) { * Used to check requirments * * @Return 1 - * Returns 1 + * Returns 1 */ //------------------------------------------------------------- // Usable @@ -1159,32 +1159,32 @@ function checkrequirements() * * * @param $cmd - * The command + * The command * @param $lines * * @param $errco - * The error code + * The error code * @Return ""; - * Return empty string + * Return empty string * @Return $lines[count($lines)-1] - * Returns numba of lines + * Returns numba of lines */ //------------------------------------------------------------- // Usable function myExec($_cmd, &$lines, &$errco) { - $cmd = "$_cmd ; echo $?"; - exec($cmd, $lines); - // Get rid of the last errco line... - $errco = (integer) array_pop($lines); - if (count($lines) == 0) - { - return ""; - } - else - { - return $lines[count($lines) - 1]; - } + $cmd = "$_cmd ; echo $?"; + exec($cmd, $lines); + // Get rid of the last errco line... + $errco = (integer) array_pop($lines); + if (count($lines) == 0) + { + return ""; + } + else + { + return $lines[count($lines) - 1]; + } } //------------------------------------------------------------ /** @@ -1193,32 +1193,32 @@ function myExec($_cmd, &$lines, &$errco) * used to delete a file if it exists * * @param $file - * The file to be deleted + * The file to be deleted */ //------------------------------------------------------------- // Usable function myDelete($file) { - if (file_exists($file)) - { - chmod($file,0777); - if (is_dir($file)) - { - $handle = opendir($file); - while($filename = readdir($handle)) - { - if ($filename != "." && $filename != "..") - { - myDelete($file."/".$filename); - } - } - closedir($handle); - rmdir($file); - } - else - { - unlink($file); - } - } + if (file_exists($file)) + { + chmod($file,0777); + if (is_dir($file)) + { + $handle = opendir($file); + while($filename = readdir($handle)) + { + if ($filename != "." && $filename != "..") + { + myDelete($file."/".$filename); + } + } + closedir($handle); + rmdir($file); + } + else + { + unlink($file); + } + } } //------------------------------------------------------------ /** @@ -1227,41 +1227,41 @@ function myDelete($file) { * Prints out error messages * * @param $message - * The message + * The message * @param $submessage - * The submessage + * The submessage */ //------------------------------------------------------------- // Not Usable -> INTERFACE Based function printError($message, $submessage) { - global $default; + global $default; global $sess, $parent, $expand, $order, $sortorder ,$sortname, $userid; global $language; - require("$default->owl_fs_root/locale/$default->owl_lang/language.inc"); - include("./lib/header.inc"); + require("$default->owl_fs_root/locale/$default->owl_lang/language.inc"); + include("./lib/header.inc"); - if(check_auth($parent, "folder_view", $userid) != "1") { - $sql = new Owl_DB; + if(check_auth($parent, "folder_view", $userid) != "1") { + $sql = new Owl_DB; $sql->query("select * from $default->owl_folders_table where id = '$parent'"); $sql->next_record(); $parent = $sql->f("parent"); - } - - echo("table_expand_width BGCOLOR=\"#d0d0d0\" CELLSPACING=0 CELLPADDING=0 BORDER=0 HEIGHT=30>"); - echo(""); - print("
"); - print("$lang_user: "); - print(""); - print uid_to_name($userid); - print (""); - print(" $lang_logout"); - print(""); - print("


"); - print $message; + } + + echo("table_expand_width BGCOLOR=\"#d0d0d0\" CELLSPACING=0 CELLPADDING=0 BORDER=0 HEIGHT=30>"); + echo(""); + print("
"); + print("$lang_user: "); + print(""); + print uid_to_name($userid); + print (""); + print(" $lang_logout"); + print(""); + print("


"); + print $message; print("
"); - print $submessage; - include("./lib/footer.inc"); + print $submessage; + include("./lib/footer.inc"); exit(); } //------------------------------------------------------------ @@ -1275,34 +1275,34 @@ function printError($message, $submessage) { // Usable function getprefs ( ) { - global $default; - - $sql = new Owl_DB; - //$sql->query("select * from $default->owl_prefs_table"); - $sql->query("select * from prefs"); - $sql->next_record(); - - $default->owl_email_from = $sql->f("email_from"); - $default->owl_email_fromname = $sql->f("email_fromname"); - $default->owl_email_replyto = $sql->f("email_replyto"); - $default->owl_email_server = $sql->f("email_server"); - $default->owl_LookAtHD = $sql->f("lookathd"); - $default->owl_def_file_security = $sql->f("def_file_security"); - $default->owl_def_file_group_owner= $sql->f("def_file_group_owner"); - $default->owl_def_file_owner = $sql->f("def_file_owner"); - $default->owl_def_file_title = $sql->f("def_file_title"); - $default->owl_def_file_meta = $sql->f("def_file_meta"); - $default->owl_def_fold_security = $sql->f("def_fold_security"); - $default->owl_def_fold_group_owner= $sql->f("def_fold_group_owner"); - $default->owl_def_fold_owner = $sql->f("def_fold_owner"); - $default->max_filesize = $sql->f("max_filesize"); - $default->owl_timeout = $sql->f("timeout"); - $default->expand = $sql->f("expand"); - $default->owl_version_control = $sql->f("version_control"); - $default->restrict_view = $sql->f("restrict_view"); - $default->dbdump_path = $sql->f("dbdump_path"); - $default->gzip_path = $sql->f("gzip_path"); - $default->tar_path = $sql->f("tar_path"); + global $default; + + $sql = new Owl_DB; + //$sql->query("select * from $default->owl_prefs_table"); + $sql->query("select * from prefs"); + $sql->next_record(); + + $default->owl_email_from = $sql->f("email_from"); + $default->owl_email_fromname = $sql->f("email_fromname"); + $default->owl_email_replyto = $sql->f("email_replyto"); + $default->owl_email_server = $sql->f("email_server"); + $default->owl_LookAtHD = $sql->f("lookathd"); + $default->owl_def_file_security = $sql->f("def_file_security"); + $default->owl_def_file_group_owner= $sql->f("def_file_group_owner"); + $default->owl_def_file_owner = $sql->f("def_file_owner"); + $default->owl_def_file_title = $sql->f("def_file_title"); + $default->owl_def_file_meta = $sql->f("def_file_meta"); + $default->owl_def_fold_security = $sql->f("def_fold_security"); + $default->owl_def_fold_group_owner= $sql->f("def_fold_group_owner"); + $default->owl_def_fold_owner = $sql->f("def_fold_owner"); + $default->max_filesize = $sql->f("max_filesize"); + $default->owl_timeout = $sql->f("timeout"); + $default->expand = $sql->f("expand"); + $default->owl_version_control = $sql->f("version_control"); + $default->restrict_view = $sql->f("restrict_view"); + $default->dbdump_path = $sql->f("dbdump_path"); + $default->gzip_path = $sql->f("gzip_path"); + $default->tar_path = $sql->f("tar_path"); }; @@ -1319,23 +1319,23 @@ function getprefs ( ) function gethtmlprefs ( ) { - global $default; - - $sql = new Owl_DB; - $sql->query("select * from $default->owl_html_table"); - $sql->next_record(); - - $default->table_border = $sql->f("table_border"); - $default->table_header_bg = $sql->f("table_header_bg"); - $default->table_cell_bg = $sql->f("table_cell_bg"); - $default->table_cell_bg_alt = $sql->f("table_cell_bg_alt"); - $default->table_expand_width = $sql->f("table_expand_width"); - $default->table_collapse_width = $sql->f("table_collapse_width"); - $default->main_header_bgcolor = $sql->f("main_header_bgcolor"); - $default->body_bgcolor = $sql->f("body_bgcolor"); - $default->body_textcolor = $sql->f("body_textcolor"); - $default->body_link = $sql->f("body_link"); - $default->body_vlink = $sql->f("body_vlink"); + global $default; + + $sql = new Owl_DB; + $sql->query("select * from $default->owl_html_table"); + $sql->next_record(); + + $default->table_border = $sql->f("table_border"); + $default->table_header_bg = $sql->f("table_header_bg"); + $default->table_cell_bg = $sql->f("table_cell_bg"); + $default->table_cell_bg_alt = $sql->f("table_cell_bg_alt"); + $default->table_expand_width = $sql->f("table_expand_width"); + $default->table_collapse_width = $sql->f("table_collapse_width"); + $default->main_header_bgcolor = $sql->f("main_header_bgcolor"); + $default->body_bgcolor = $sql->f("body_bgcolor"); + $default->body_textcolor = $sql->f("body_textcolor"); + $default->body_link = $sql->f("body_link"); + $default->body_vlink = $sql->f("body_vlink"); }; //------------------------------------------------------------ @@ -1345,20 +1345,20 @@ function gethtmlprefs ( ) * Print file permissions * * @param $currentval - * The current value + * The current value * @param $namevariable - * The name of the file + * The name of the file * @param $pringmessage - * The message to be printed + * The message to be printed * @param $type - * The type of file + * The type of file */ //------------------------------------------------------------- // SEMI-Usable Interface based function printfileperm($currentval, $namevariable, $printmessage, $type) { - global $default; - global $lang_everyoneread, $lang_everyonewrite, $lang_everyonewrite_nod, $lang_groupread, $lang_groupwrite, $lang_groupwrite_nod, $lang_groupwrite_worldread, $lang_groupwrite_worldread_nod, $lang_onlyyou; - global $lang_everyoneread_ad, $lang_everyonewrite_ad, $lang_everyonewrite_ad_nod, $lang_groupread_ad, $lang_groupwrite_ad, $lang_groupwrite_ad_nod, $lang_groupwrite_worldread_ad, $lang_groupwrite_worldread_ad_nod, $lang_onlyyou_ad; + global $default; + global $lang_everyoneread, $lang_everyonewrite, $lang_everyonewrite_nod, $lang_groupread, $lang_groupwrite, $lang_groupwrite_nod, $lang_groupwrite_worldread, $lang_groupwrite_worldread_nod, $lang_onlyyou; + global $lang_everyoneread_ad, $lang_everyonewrite_ad, $lang_everyonewrite_ad_nod, $lang_groupread_ad, $lang_groupwrite_ad, $lang_groupwrite_ad_nod, $lang_groupwrite_worldread_ad, $lang_groupwrite_worldread_ad_nod, $lang_onlyyou_ad; $file_perm[0][0] = 0; @@ -1370,31 +1370,31 @@ function printfileperm($currentval, $namevariable, $printmessage, $type) { $file_perm[6][0] = 6; $file_perm[7][0] = 7; $file_perm[8][0] = 8; - - // show admin permissions - if ($type == "admin") - { - $file_perm[0][1] = "$lang_everyoneread_ad"; - $file_perm[1][1] = "$lang_everyonewrite_ad"; - $file_perm[2][1] = "$lang_groupread_ad"; - $file_perm[3][1] = "$lang_groupwrite_ad"; - $file_perm[4][1] = "$lang_onlyyou_ad"; - $file_perm[5][1] = "$lang_groupwrite_ad_nod"; - $file_perm[6][1] = "$lang_everyonewrite_ad_nod"; - $file_perm[7][1] = "$lang_groupwrite_worldread_ad"; - $file_perm[8][1] = "$lang_groupwrite_worldread_ad_nod"; - } - else {// otherwise show other permissions - $file_perm[0][1] = "$lang_everyoneread"; - $file_perm[1][1] = "$lang_everyonewrite"; - $file_perm[2][1] = "$lang_groupread"; - $file_perm[3][1] = "$lang_groupwrite"; - $file_perm[4][1] = "$lang_onlyyou"; - $file_perm[5][1] = "$lang_groupwrite_nod"; - $file_perm[6][1] = "$lang_everyonewrite_nod"; - $file_perm[7][1] = "$lang_groupwrite_worldread"; - $file_perm[8][1] = "$lang_groupwrite_worldread_nod"; - } + + // show admin permissions + if ($type == "admin") + { + $file_perm[0][1] = "$lang_everyoneread_ad"; + $file_perm[1][1] = "$lang_everyonewrite_ad"; + $file_perm[2][1] = "$lang_groupread_ad"; + $file_perm[3][1] = "$lang_groupwrite_ad"; + $file_perm[4][1] = "$lang_onlyyou_ad"; + $file_perm[5][1] = "$lang_groupwrite_ad_nod"; + $file_perm[6][1] = "$lang_everyonewrite_ad_nod"; + $file_perm[7][1] = "$lang_groupwrite_worldread_ad"; + $file_perm[8][1] = "$lang_groupwrite_worldread_ad_nod"; + } + else {// otherwise show other permissions + $file_perm[0][1] = "$lang_everyoneread"; + $file_perm[1][1] = "$lang_everyonewrite"; + $file_perm[2][1] = "$lang_groupread"; + $file_perm[3][1] = "$lang_groupwrite"; + $file_perm[4][1] = "$lang_onlyyou"; + $file_perm[5][1] = "$lang_groupwrite_nod"; + $file_perm[6][1] = "$lang_everyonewrite_nod"; + $file_perm[7][1] = "$lang_groupwrite_worldread"; + $file_perm[8][1] = "$lang_groupwrite_worldread_nod"; + } print("table_header_bg>$printmessage"); foreach($group_perm as $fp) @@ -1655,7 +1655,7 @@ if(isset($default->owl_lang)) { $langdir = "$default->owl_fs_root/locale/$default->owl_lang"; - if(is_dir("$langdir") != 1) { + if(is_dir("$langdir") != 1) { die("$lang_err_lang_1 $langdir $lang_err_lang_2"); } else { @@ -1687,8 +1687,8 @@ if ($sess) { gethtmlprefs(); $ok = verify_session($sess); $temporary_ok = $ok["bit"]; - $userid = $ok["userid"]; - $usergroupid = $ok["groupid"]; + $userid = $ok["userid"]; + $usergroupid = $ok["groupid"]; if ($ok["bit"] != "1") { // Bozz Bug Fix begin @@ -1702,21 +1702,21 @@ if ($sess) { if ($parent == "" || $fileid == "") { print(""); } else { - print(""); + print(""); } - exit; + exit; } else { - $lastused = time(); - $sql = new Owl_DB; - $sql->query("update $default->owl_sessions_table set lastused = '$lastused' where uid = '$userid'"); - } + $lastused = time(); + $sql = new Owl_DB; + $sql->query("update $default->owl_sessions_table set lastused = '$lastused' where uid = '$userid'"); + } } if (!$sess && !$loginname && !$login) { - if(!isset($fileid)) { - header("Location: " . $default->owl_root_url . "/index.php?login=1"); + if(!isset($fileid)) { + header("Location: " . $default->owl_root_url . "/index.php?login=1"); } else { - header("Location: " . $default->owl_root_url . "/index.php?login=1&fileid=$fileid&parent=$parent"); + header("Location: " . $default->owl_root_url . "/index.php?login=1&fileid=$fileid&parent=$parent"); } } */ -- libgit2 0.21.4