diff --git a/phpgwapi/inc/class.accounts_shared.inc.php b/phpgwapi/inc/class.accounts_shared.inc.php index f0aac76abe..1ac0a11b21 100644 --- a/phpgwapi/inc/class.accounts_shared.inc.php +++ b/phpgwapi/inc/class.accounts_shared.inc.php @@ -55,15 +55,15 @@ function memberships($account_id = False) { global $phpgw_info, $phpgw; - if ($account_id == ""){ $account_id = $phpgw_info["user"]["account_id"]; } - elseif (gettype($account_id) == "string") { $account_id = $this->name2id($account_id); } + if ($account_id == ''){ $account_id = $phpgw_info['user']['account_id']; } + elseif (gettype($account_id) == 'string') { $account_id = $this->name2id($account_id); } $security_equals = Array(); - $security_equals = $phpgw->acl->get_location_list_for_id("phpgw_group", 1, intval($account_id)); + $security_equals = $phpgw->acl->get_location_list_for_id('phpgw_group', 1, intval($account_id)); if (!$security_equals) { return False; } for ($idx=0; $idxid2name(intval($security_equals[$idx])); - $this->memberships[] = Array("account_id" => $security_equals[$idx], "account_name" => "$name"); + $this->memberships[] = Array('account_id' => $security_equals[$idx], 'account_name' => "$name"); } return $this->memberships; } diff --git a/phpgwapi/inc/class.applications.inc.php b/phpgwapi/inc/class.applications.inc.php index 82c6cd00f6..d3def6d5ac 100755 --- a/phpgwapi/inc/class.applications.inc.php +++ b/phpgwapi/inc/class.applications.inc.php @@ -45,15 +45,15 @@ function read_repository() { global $phpgw, $phpgw_info; - if (gettype($phpgw_info["apps"]) != "array") { + if (gettype($phpgw_info['apps']) != 'array') { $this->read_installed_apps(); } $this->data = Array(); - reset($phpgw_info["apps"]); - while ($app = each($phpgw_info["apps"])) { - $check = $phpgw->acl->check("run",1,$app[0]); + reset($phpgw_info['apps']); + while ($app = each($phpgw_info['apps'])) { + $check = $phpgw->acl->check('run',1,$app[0]); if ($check) { - $this->data[$app[0]] = array("title" => $phpgw_info["apps"][$app[0]]["title"], "name" => $app[0], "enabled" => True, "status" => $phpgw_info["apps"][$app[0]]["status"]); + $this->data[$app[0]] = array('title' => $phpgw_info['apps'][$app[0]]['title'], 'name' => $app[0], 'enabled' => True, 'status' => $phpgw_info['apps'][$app[0]]['status']); } } reset($this->data); @@ -68,12 +68,12 @@ function add($apps) { global $phpgw_info; - if(gettype($apps) == "array") { + if(gettype($apps) == 'array') { while($app = each($apps)) { - $this->data[$app[1]] = array("title" => $phpgw_info["apps"][$app[1]]["title"], "name" => $app[1], "enabled" => True, "status" => $phpgw_info["apps"][$app[1]]["status"]); + $this->data[$app[1]] = array('title' => $phpgw_info['apps'][$app[1]]['title'], 'name' => $app[1], 'enabled' => True, 'status' => $phpgw_info['apps'][$app[1]]['status']); } } elseif(gettype($apps)) { - $this->data[$apps] = array("title" => $phpgw_info["apps"][$apps]["title"], "name" => $apps, "enabled" => True, "status" => $phpgw_info["apps"][$apps]["status"]); + $this->data[$apps] = array('title' => $phpgw_info['apps'][$apps]['title'], 'name' => $apps, 'enabled' => True, 'status' => $phpgw_info['apps'][$apps]['status']); } reset($this->data); return $this->data; @@ -119,7 +119,7 @@ } @reset($this->data); while (list ($key) = each ($this->data)) { - $app[] = $this->data[$key]["name"]; + $app[] = $this->data[$key]['name']; } return $app; } diff --git a/phpgwapi/inc/class.auth.inc.php b/phpgwapi/inc/class.auth.inc.php index a9946ab3b3..fbbb23ac4d 100644 --- a/phpgwapi/inc/class.auth.inc.php +++ b/phpgwapi/inc/class.auth.inc.php @@ -1,4 +1,4 @@ \ No newline at end of file + if (empty($phpgw_info['server']['auth_type'])){$phpgw_info['server']['auth_type'] = 'sql';} + include(PHPGW_API_INC.'/class.auth_'.$phpgw_info['server']['auth_type'].'.inc.php'); +?> diff --git a/phpgwapi/inc/class.auth_ldap.inc.php b/phpgwapi/inc/class.auth_ldap.inc.php index 48c3d97523..be531aceae 100644 --- a/phpgwapi/inc/class.auth_ldap.inc.php +++ b/phpgwapi/inc/class.auth_ldap.inc.php @@ -33,15 +33,15 @@ // these are just "warnings" and can be ignored..... error_reporting(0); - $ldap = ldap_connect($phpgw_info["server"]["ldap_host"]); + $ldap = ldap_connect($phpgw_info['server']['ldap_host']); // find the dn for this uid, the uid is not always in the dn - $sri = ldap_search($ldap, $phpgw_info["server"]["ldap_context"], "uid=$username"); + $sri = ldap_search($ldap, $phpgw_info['server']['ldap_context'], 'uid='.$username); $allValues = ldap_get_entries($ldap, $sri); - if($allValues["count"] > 0) + if($allValues['count'] > 0) { // we only care about the first dn - $userDN = $allValues[0]["dn"]; + $userDN = $allValues[0]['dn']; // generate a bogus password to pass if the user doesn't give us one // this gets around systems that are anonymous search enabled @@ -63,9 +63,9 @@ $ldap = $phpgw->common->ldapConnect(); $encrypted_passwd = $phpgw->common->encrypt_password($new_passwd); - $entry["userpassword"] = $encrypted_passwd; - #$entry["phpgw_lastpasswd_change"] = time(); - $dn = $phpgw_info["user"]["account_dn"]; + $entry['userpassword'] = $encrypted_passwd; + #$entry['phpgw_lastpasswd_change'] = time(); + $dn = $phpgw_info['user']['account_dn']; if (!@ldap_modify($ldap, $dn, $entry)) return false; diff --git a/phpgwapi/inc/class.auth_mail.inc.php b/phpgwapi/inc/class.auth_mail.inc.php index a5db4b38a7..d432a2b9da 100644 --- a/phpgwapi/inc/class.auth_mail.inc.php +++ b/phpgwapi/inc/class.auth_mail.inc.php @@ -31,21 +31,21 @@ error_reporting(error_reporting() - 2); - if ($phpgw_info["server"]["mail_login_type"] == "vmailmgr") { - $username = $username . "@" . $phpgw_info[server][mail_suffix]; + if ($phpgw_info['server']['mail_login_type'] == 'vmailmgr') { + $username = $username . '@' . $phpgw_info['server']['mail_suffix']; } - if ($phpgw_info["server"]["mail_server_type"]=="imap") { - $phpgw_info["server"]["mail_port"] = "143"; - } elseif ($phpgw_info["server"]["mail_server_type"]=="pop3") { - $phpgw_info["server"]["mail_port"] = "110"; + if ($phpgw_info['server']['mail_server_type']=='imap') { + $phpgw_info['server']['mail_port'] = '143'; + } elseif ($phpgw_info['server']['mail_server_type']=='pop3') { + $phpgw_info['server']['mail_port'] = '110'; } - if( $phpgw_info["server"]["mail_server_type"]=="pop3") { - $mailauth = imap_open("{".$phpgw_info["server"]["mail_server"]."/pop3" - .":".$phpgw_info["server"]["mail_port"]."}INBOX", $username , $passwd); + if( $phpgw_info['server']['mail_server_type']=='pop3') { + $mailauth = imap_open('{'.$phpgw_info['server']['mail_server'].'/pop3' + .':'.$phpgw_info['server']['mail_port'].'}INBOX', $username , $passwd); } else { //assume imap - $mailauth = imap_open("{".$phpgw_info["server"]["mail_server"] - .":".$phpgw_info["server"]["mail_port"]."}INBOX", $username , $passwd); + $mailauth = imap_open('{'.$phpgw_info['server']['mail_server'] + .':'.$phpgw_info['server']['mail_port'].'}INBOX', $username , $passwd); } error_reporting(error_reporting() + 2); diff --git a/phpgwapi/inc/class.auth_sql.inc.php b/phpgwapi/inc/class.auth_sql.inc.php index ba5c9232e3..4687dfbe00 100644 --- a/phpgwapi/inc/class.auth_sql.inc.php +++ b/phpgwapi/inc/class.auth_sql.inc.php @@ -36,7 +36,7 @@ . "account_pwd='" . md5($passwd) . "' AND account_status ='A'",__LINE__,__FILE__); $db->next_record(); - if ($db->f("account_lid")) { + if ($db->f('account_lid')) { return True; } else { return False; diff --git a/phpgwapi/inc/class.categories.inc.php b/phpgwapi/inc/class.categories.inc.php index f86c725232..6445427521 100644 --- a/phpgwapi/inc/class.categories.inc.php +++ b/phpgwapi/inc/class.categories.inc.php @@ -34,17 +34,17 @@ { switch ($type) { - case "subs": $s = " and cat_parent != '0'"; break; - case "mains": $s = " and cat_parent = '0'"; break; + case 'subs': $s = " and cat_parent != '0'"; break; + case 'mains': $s = " and cat_parent = '0'"; break; } return $s; } - function return_array($type = "all", $id = "") + function return_array($type = 'all', $id = '') { $filter = $this->filter($type); - if ($type == "single") { + if ($type == 'single') { $filter = " and cat_id='$id'"; } @@ -53,25 +53,25 @@ . $this->app_name . "' $filter",__LINE__,__FILE__); $i = 0; while ($this->db->next_record()) { - $cats[$i]["id"] = $this->db->f("cat_id"); - $cats[$i]["parent"] = $this->db->f("cat_parent"); - $cats[$i]["name"] = $this->db->f("cat_name"); - $cats[$i]["description"] = $this->db->f("cat_description"); - $cats[$i]["data"] = $this->db->f("cat_data"); + $cats[$i]['id'] = $this->db->f('cat_id'); + $cats[$i]['parent'] = $this->db->f('cat_parent'); + $cats[$i]['name'] = $this->db->f('cat_name'); + $cats[$i]['description'] = $this->db->f('cat_description'); + $cats[$i]['data'] = $this->db->f('cat_data'); $i++; } return $cats; } - function categories($account_id = "",$app_name = "") + function categories($account_id = '',$app_name = '') { global $phpgw, $phpgw_info; if (! $account_id) { - $account_id = $phpgw_info["user"]["account_id"]; + $account_id = $phpgw_info['user']['account_id']; } if (! $app_name) { - $app_name = $phpgw_info["flags"]["currentapp"]; + $app_name = $phpgw_info['flags']['currentapp']; } $this->account_id = $account_id; @@ -86,15 +86,15 @@ global $phpgw; $filter = $this->filter($type); - if ($format == "select") { + if ($format == 'select') { $this->db->query("select * from phpgw_categories where cat_owner='" . $this->account_id . "' $filter",__LINE__,__FILE__); while ($this->db->next_record()) { - $s .= ''; } return $s; @@ -102,9 +102,9 @@ } - function add($cat_name,$cat_parent,$cat_description = "", $cat_data = "") + function add($cat_name,$cat_parent,$cat_description = '', $cat_data = '') { - $this->db->query("insert into phpgw_categories (cat_parent,cat_owner,cat_appname,cat_name," + $this->db->query('insert into phpgw_categories (cat_parent,cat_owner,cat_appname,cat_name,' . "cat_description,cat_data) values ('$cat_parent','" . $this->account_id . "','" . $this->app_name . "','" . addslashes($cat_name) . "','" . addslashes($cat_description) . "','$cat_data')",__LINE__,__FILE__); @@ -116,7 +116,7 @@ . $this->account_id . "'",__LINE__,__FILE__); } - function edit($cat_id,$cat_parent,$cat_name,$cat_description = "",$cat_data = "") + function edit($cat_id,$cat_parent,$cat_name,$cat_description = '',$cat_data = '') { $this->db->query("update phpgw_categories set cat_name='" . addslashes($cat_name) . "', " . "cat_description='" . addslashes($cat_description) . "', cat_data='" @@ -129,10 +129,10 @@ $this->db->query("select cat_name from phpgw_categories where cat_id='" . "$cat_id'",__LINE__,__FILE__); $this->db->next_record(); - if ($this->db->f("cat_name")) { - return $this->db->f("cat_name"); + if ($this->db->f('cat_name')) { + return $this->db->f('cat_name'); } else { - return "--"; + return '--'; } } diff --git a/phpgwapi/inc/class.clientsniffer.inc.php b/phpgwapi/inc/class.clientsniffer.inc.php index b25e48c454..1a227df7e7 100644 --- a/phpgwapi/inc/class.clientsniffer.inc.php +++ b/phpgwapi/inc/class.clientsniffer.inc.php @@ -57,17 +57,17 @@ /* $Id$ */ class clientsniffer -{ var $UA = ""; - var $NAME = "Unknown"; +{ var $UA = ''; + var $NAME = 'Unknown'; var $VERSION = 0; var $MAJORVER = 0; var $MINORVER = 0; var $AOL = false; var $WEBTV = false; var $JS = 0.0; - var $PLATFORM = "Unknown"; - var $OS = "Unknown"; - var $IP = "Unknown"; + var $PLATFORM = 'Unknown'; + var $OS = 'Unknown'; + var $IP = 'Unknown'; /* START CONSTRUCTOR */ function clientsniffer() @@ -112,7 +112,7 @@ class clientsniffer // Determine Major and Minor Version if($this->VERSION > 0) - { $pos = strpos($this->VERSION,"."); + { $pos = strpos($this->VERSION,'.'); if ($pos > 0) { $this->MAJORVER = substr($this->VERSION,0,$pos); $this->MINORVER = substr($this->VERSION,$pos,strlen($this->VERSION)); @@ -127,141 +127,141 @@ class clientsniffer eregi('windows 3.1',$this->UA) || eregi('windows 16-bit',$this->UA) || eregi('16bit',$this->UA)) - { $this->PLATFORM = "Win16"; - $this->OS = "Win31"; + { $this->PLATFORM = 'Win16'; + $this->OS = 'Win31'; } // Check for Windows 32-bit if(eregi('Win95',$this->UA) || eregi('windows 95',$this->UA)) - { $this->PLATFORM = "Win32"; - $this->OS = "Win95"; + { $this->PLATFORM = 'Win32'; + $this->OS = 'Win95'; } elseif(eregi('Win98',$this->UA) || eregi('windows 98',$this->UA)) - { $this->PLATFORM = "Win32"; - $this->OS = "Win98"; + { $this->PLATFORM = 'Win32'; + $this->OS = 'Win98'; } elseif(eregi('WinNT',$this->UA) || eregi('windows NT',$this->UA)) - { $this->PLATFORM = "Win32"; - $this->OS = "WinNT"; + { $this->PLATFORM = 'Win32'; + $this->OS = 'WinNT'; } else - { $this->PLATFORM = "Win32"; - $this->OS = "Win9xNT"; + { $this->PLATFORM = 'Win32'; + $this->OS = 'Win9xNT'; } // Check for OS/2 if( eregi('os/2',$this->UA) || eregi('ibm-webexplorer',$this->UA)) - { $this->PLATFORM = "OS2"; - $this->OS = "OS2"; + { $this->PLATFORM = 'OS2'; + $this->OS = 'OS2'; } // Check for Mac 68000 if( eregi('68k',$this->UA) || eregi('68000',$this->UA)) - { $this->PLATFORM = "Mac"; - $this->OS = "Mac68k"; + { $this->PLATFORM = 'Mac'; + $this->OS = 'Mac68k'; } //Check for Mac PowerPC if( eregi('ppc',$this->UA) || eregi('powerpc',$this->UA)) - { $this->PLATFORM = "Mac"; - $this->OS = "MacPPC"; + { $this->PLATFORM = 'Mac'; + $this->OS = 'MacPPC'; } // Check for Unix Flavor //SunOS if(eregi('sunos',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "sun"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'sun'; } if(eregi('sunos 4',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "sun4"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'sun4'; } elseif(eregi('sunos 5',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "sun5"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'sun5'; } elseif(eregi('i86',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "suni86"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'suni86'; } // Irix if(eregi('irix',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "irix"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'irix'; } if(eregi('irix 6',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "irix6"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'irix6'; } elseif(eregi('irix 5',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "irix5"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'irix5'; } //HP-UX if(eregi('hp-ux',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "hpux"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'hpux'; } if(eregi('hp-ux',$this->UA) && ereg('10.',$this-UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "hpux10"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'hpux10'; } elseif(eregi('hp-ux',$this->UA) && ereg('09.',$this-UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "hpux9"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'hpux9'; } //AIX if(eregi('aix',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "aix"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'aix'; } if(eregi('aix1',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "aix1"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'aix1'; } elseif(eregi('aix2',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "aix2"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'aix2'; } elseif(eregi('aix3',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "aix3"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'aix3'; } elseif(eregi('aix4',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "aix4"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'aix4'; } // Linux if(eregi('inux',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "linux"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'linux'; } //Unixware if(eregi('unix_system_v',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "unixware"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'unixware'; } //mpras if(eregi('ncr',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "mpras"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'mpras'; } //Reliant if(eregi('reliantunix',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "reliant"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'reliant'; } // DEC @@ -270,55 +270,55 @@ class clientsniffer eregi('alphaserver',$this->UA) || eregi('ultrix',$this->UA) || eregi('alphastation',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "dec"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'dec'; } // Sinix if(eregi('sinix',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "sinix"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'sinix'; } // FreeBSD if(eregi('freebsd',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "freebsd"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'freebsd'; } // BSD if(eregi('bsd',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "bsd"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'bsd'; } // VMS if(eregi('vax',$this->UA) || eregi('openvms',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "vms"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'vms'; } // SCO if(eregi('sco',$this->UA) || eregi('unix_sv',$this->UA)) - { $this->PLATFORM = "Unix"; - $this->OS = "sco"; + { $this->PLATFORM = 'Unix'; + $this->OS = 'sco'; } // Assume JavaScript Version // make the code a bit easier to read - $ie = eregi("ie",$this->NAME); - $ie5 = ( eregi("ie",$this->NAME) && ($this->MAJORVER >= 5) ); - $ie4 = ( eregi("ie",$this->NAME) && ($this->MAJORVER >= 4) ); - $ie3 = ( eregi("ie",$this->NAME) && ($this->MAJORVER >= 3) ); + $ie = eregi('ie',$this->NAME); + $ie5 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >= 5) ); + $ie4 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >= 4) ); + $ie3 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >= 3) ); - $nav = eregi("netscape",$this->NAME); - $nav5 = ( eregi("netscape",$this->NAME) && ($this->MAJORVER >= 5) ); - $nav4 = ( eregi("netscape",$this->NAME) && ($this->MAJORVER >= 4) ); - $nav3 = ( eregi("netscape",$this->NAME) && ($this->MAJORVER >= 3) ); - $nav2 = ( eregi("netscape",$this->NAME) && ($this->MAJORVER >= 2) ); + $nav = eregi('netscape',$this->NAME); + $nav5 = ( eregi('netscape',$this->NAME) && ($this->MAJORVER >= 5) ); + $nav4 = ( eregi('netscape',$this->NAME) && ($this->MAJORVER >= 4) ); + $nav3 = ( eregi('netscape',$this->NAME) && ($this->MAJORVER >= 3) ); + $nav2 = ( eregi('netscape',$this->NAME) && ($this->MAJORVER >= 2) ); - $opera = eregi("opera",$this->NAME); + $opera = eregi('opera',$this->NAME); // do the assumption // update as new versions are released diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index 6765ecbd72..b7c891aa34 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -25,34 +25,34 @@ /* $Id$ */ - $d1 = strtolower(substr($phpgw_info["server"]["api_inc"],0,3)); - $d2 = strtolower(substr($phpgw_info["server"]["server_root"],0,3)); - $d3 = strtolower(substr($phpgw_info["server"]["app_inc"],0,3)); - if($d1 == "htt" || $d1 == "ftp" || $d2 == "htt" || $d2 == "ftp" || $d3 == "htt" || $d3 == "ftp") { - echo "Failed attempt to break in via an old Security Hole!
\n"; + $d1 = strtolower(substr($phpgw_info['server']['api_inc'],0,3)); + $d2 = strtolower(substr($phpgw_info['server']['server_root'],0,3)); + $d3 = strtolower(substr($phpgw_info['server']['app_inc'],0,3)); + if($d1 == 'htt' || $d1 == 'ftp' || $d2 == 'htt' || $d2 == 'ftp' || $d3 == 'htt' || $d3 == 'ftp') { + echo 'Failed attempt to break in via an old Security Hole!
'."\n"; exit; } unset($d1);unset($d2);unset($d3); class common { var $phpgw; - var $iv = ""; - var $key = ""; + var $iv = ''; + var $key = ''; var $crypto; // Convert an array into the format needed for the access column. function array_to_string($access,$array) { - $s = ""; - if ($access == "group" || $access == "public" || $access == "none") { + $s = ''; + if ($access == 'group' || $access == 'public' || $access == 'none') { if (count($array)) { while ($t = each($array)) { - $s .= "," . $t[1]; + $s .= ',' . $t[1]; } - $s .= ","; + $s .= ','; } - if (! count($array) && $access == "none") { - $s = ""; + if (! count($array) && $access == 'none') { + $s = ''; } } return $s; @@ -64,12 +64,12 @@ { global $phpgw, $phpgw_info; - $s = ""; + $s = ''; if (!$owner) { - $owner = $phpgw_info["user"]["account_id"]; + $owner = $phpgw_info['user']['account_id']; } $groups = $phpgw->accounts->memberships(intval($owner)); - if (gettype($groups) == "array") { + if (gettype($groups) == 'array') { while ($group = each($groups)) { $s .= " or $table like '%," . $group[2] . ",%'"; } @@ -82,10 +82,10 @@ { global $phpgw; - $phpgw->db->query("select distinct lang from lang"); + $phpgw->db->query('select distinct lang from lang'); while (@$phpgw->db->next_record()) { - $installedLanguages[$phpgw->db->f("lang")] = $phpgw->db->f("lang"); + $installedLanguages[$phpgw->db->f('lang')] = $phpgw->db->f('lang'); } return $installedLanguages; @@ -99,17 +99,17 @@ global $HTTP_ACCEPT_LANGUAGE; // create a array of languages the user is accepting - $userLanguages = explode(",",$HTTP_ACCEPT_LANGUAGE); + $userLanguages = explode(',',$HTTP_ACCEPT_LANGUAGE); $supportedLanguages = $this->getInstalledLanguages(); // find usersupported language while (list($key,$value) = each($userLanguages)) { - // remove everything behind "-" example: de-de + // remove everything behind '-' example: de-de $value = trim($value); - $pieces = explode("-", $value); + $pieces = explode('-', $value); $value = $pieces[0]; - # print "current lang $value
"; + # print 'current lang $value
'; if ($supportedLanguages[$value]) { $retValue=$value; @@ -120,27 +120,27 @@ // no usersupported language found -> return english if (empty($retValue)) { - $retValue="en"; + $retValue='en'; } return $retValue; } // connect to the ldap server and return a handle - function ldapConnect($host = "", $dn = "", $passwd = "") + function ldapConnect($host = '', $dn = '', $passwd = '') { global $phpgw_info; if (! $host) { - $host = $phpgw_info["server"]["ldap_host"]; + $host = $phpgw_info['server']['ldap_host']; } if (! $dn) { - $dn = $phpgw_info["server"]["ldap_root_dn"]; + $dn = $phpgw_info['server']['ldap_root_dn']; } if (! $passwd) { - $passwd = $phpgw_info["server"]["ldap_root_passwd"]; + $passwd = $phpgw_info['server']['ldap_root_passwd']; } @@ -174,12 +174,12 @@ function randomstring($size) { - $s = ""; + $s = ''; srand((double)microtime()*1000000); - $random_char = array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f", - "g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v", - "w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L", - "M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"); + $random_char = array('0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f', + 'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v', + 'w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L', + 'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'); for ($i=0; $i<$size; $i++) { $s .= $random_char[rand(1,61)]; @@ -195,7 +195,7 @@ function error_list($error) { - $html_error = ''; + $html_error = '
' . lang("error") . ': ' . $error[0] . '
'; for ($i=1; $i'; @@ -203,17 +203,17 @@ return $html_error . '
' . lang('error') . ': ' . $error[0] . '
'; } - function check_owner($record,$link,$label,$extravars = "") + function check_owner($record,$link,$label,$extravars = '') { global $phpgw, $phpgw_info; $s = ' ' . lang($label) . ' '; if (ereg("^[0-9]+$",$record)) { - if ($record != $phpgw_info["user"]["account_id"]) { + if ($record != $phpgw_info['user']['account_id']) { $s = " "; } } else { - if ($record != $phpgw_info["user"]["userid"]) { + if ($record != $phpgw_info['user']['userid']) { $s = " "; } } @@ -221,13 +221,13 @@ return $s; } - function display_fullname($lid = "", $firstname = "", $lastname = "") + function display_fullname($lid = '', $firstname = '', $lastname = '') { if (! $lid && ! $firstname && ! $lastname) { global $phpgw_info; - $lid = $phpgw_info["user"]["account_lid"]; - $firstname = $phpgw_info["user"]["firstname"]; - $lastname = $phpgw_info["user"]["lastname"]; + $lid = $phpgw_info['user']['account_lid']; + $firstname = $phpgw_info['user']['firstname']; + $lastname = $phpgw_info['user']['lastname']; } if (! $firstname && ! $lastname) { @@ -250,17 +250,17 @@ global $phpgw; $db = $phpgw->db; - $db->query("select account_lid,account_firstname,account_lastname from phpgw_accounts where account_id=".$id,__LINE__,__FILE__); + $db->query('select account_lid,account_firstname,account_lastname from phpgw_accounts where account_id='.$id,__LINE__,__FILE__); $db->next_record(); - return $phpgw->common->display_fullname($db->f("account_lid"),$db->f("account_firstname"),$db->f("account_lastname")); + return $phpgw->common->display_fullname($db->f('account_lid'),$db->f('account_firstname'),$db->f('account_lastname')); } - function create_tabs($tabs, $selected, $fontsize = "") + function create_tabs($tabs, $selected, $fontsize = '') { global $phpgw_info; $output_text = ''; - $ir = $phpgw_info["server"]["images_dir"]; + $ir = $phpgw_info['server']['images_dir']; if ($fontsize) { $fs = ''; @@ -275,7 +275,7 @@ } $output_text .= ''; if ($i == count($tabs)) { $output_text .= ''; @@ -287,7 +287,7 @@ $output_text .= ''; } $output_text .= ''; if (($i + 1) == $selected) { $output_text .= ''; @@ -312,17 +312,17 @@ return $output_text; } - function get_app_dir($appname = ""){ + function get_app_dir($appname = ''){ global $phpgw_info; - if ($appname == "") { - $appname = $phpgw_info["flags"]["currentapp"]; + if ($appname == '') { + $appname = $phpgw_info['flags']['currentapp']; } - if ($appname == "home" || $appname == "logout" || $appname == "login") { - $appname = "phpgwapi"; + if ($appname == 'home' || $appname == 'logout' || $appname == 'login') { + $appname = 'phpgwapi'; } - $appdir = PHPGW_INCLUDE_ROOT . "/".$appname; - $appdir_default = PHPGW_SERVER_ROOT . "/".$appname; + $appdir = PHPGW_INCLUDE_ROOT . '/'.$appname; + $appdir_default = PHPGW_SERVER_ROOT . '/'.$appname; if (is_dir ($appdir)){ return $appdir; @@ -333,19 +333,19 @@ } } - function get_inc_dir($appname = "") + function get_inc_dir($appname = '') { global $phpgw_info; if (! $appname){ - $appname = $phpgw_info["flags"]["currentapp"]; + $appname = $phpgw_info['flags']['currentapp']; } - if ($appname == "home" || $appname == "logout" || $appname == "login") { - $appname = "phpgwapi"; + if ($appname == 'home' || $appname == 'logout' || $appname == 'login') { + $appname = 'phpgwapi'; } - $incdir = PHPGW_INCLUDE_ROOT . "/" . $appname . "/inc"; - $incdir_default = PHPGW_SERVER_ROOT . "/" . $appname . "/inc"; + $incdir = PHPGW_INCLUDE_ROOT . '/' . $appname . '/inc'; + $incdir_default = PHPGW_SERVER_ROOT . '/' . $appname . '/inc'; if (is_dir ($incdir)) { return $incdir; @@ -358,10 +358,10 @@ function list_themes() { - $dh = opendir(PHPGW_SERVER_ROOT . "/phpgwapi/themes"); + $dh = opendir(PHPGW_SERVER_ROOT . '/phpgwapi/themes'); while ($file = readdir($dh)) { if (eregi("\.theme$", $file)) { - $list[] = substr($file,0,strpos($file,".")); + $list[] = substr($file,0,strpos($file,'.')); } } //$dh->close(); @@ -371,16 +371,16 @@ function list_templates(){ global $phpgw_info; - $d = dir(PHPGW_SERVER_ROOT . "/phpgwapi/templates"); + $d = dir(PHPGW_SERVER_ROOT . '/phpgwapi/templates'); while ($entry=$d->read()) { - if ($entry != "CVS" && $entry != "." && $entry != ".."){ - $list[$entry]["name"] = $entry; - $f = PHPGW_SERVER_ROOT . "/phpgwapi/templates/" . $entry . "/details.inc.php"; + if ($entry != 'CVS' && $entry != '.' && $entry != '..'){ + $list[$entry]['name'] = $entry; + $f = PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry . '/details.inc.php'; if (file_exists ($f)){ include($f); - $list[$entry]["title"] = "Use ".$phpgw_info["template"][$entry]["title"]."interface"; + $list[$entry]['title'] = 'Use '.$phpgw_info['template'][$entry]['title'].'interface'; } else { - $list[$entry]["title"] = $entry; + $list[$entry]['title'] = $entry; } } } @@ -389,30 +389,30 @@ return $list; } - function get_tpl_dir($appname = "") + function get_tpl_dir($appname = '') { global $phpgw_info; if (! $appname) { - $appname = $phpgw_info["flags"]["currentapp"]; + $appname = $phpgw_info['flags']['currentapp']; } - if ($appname == "home" || $appname == "logout" || $appname == "login") { - $appname = "phpgwapi"; + if ($appname == 'home' || $appname == 'logout' || $appname == 'login') { + $appname = 'phpgwapi'; } // Setting this for display of template choices in user preferences - if ($phpgw_info["server"]["template_set"] == "user_choice") { - $phpgw_info["server"]["usrtplchoice"] = "user_choice"; + if ($phpgw_info['server']['template_set'] == 'user_choice') { + $phpgw_info['server']['usrtplchoice'] = 'user_choice'; } - if ($phpgw_info["server"]["template_set"] == "user_choice" && isset($phpgw_info["user"]["preferences"]["common"]["template_set"])) { - $phpgw_info["server"]["template_set"] = $phpgw_info["user"]["preferences"]["common"]["template_set"]; - } elseif ($phpgw_info["server"]["template_set"] == "user_choice" || !isset($phpgw_info["server"]["template_set"])) { - $phpgw_info["server"]["template_set"] = "default"; + if ($phpgw_info['server']['template_set'] == 'user_choice' && isset($phpgw_info['user']['preferences']['common']['template_set'])) { + $phpgw_info['server']['template_set'] = $phpgw_info['user']['preferences']['common']['template_set']; + } elseif ($phpgw_info['server']['template_set'] == 'user_choice' || !isset($phpgw_info['server']['template_set'])) { + $phpgw_info['server']['template_set'] = 'default'; } - $tpldir = PHPGW_SERVER_ROOT . "/" . $appname . "/templates/" - . $phpgw_info["server"]["template_set"]; - $tpldir_default = PHPGW_SERVER_ROOT . "/" . $appname . "/templates/default"; + $tpldir = PHPGW_SERVER_ROOT . '/' . $appname . '/templates/' + . $phpgw_info['server']['template_set']; + $tpldir_default = PHPGW_SERVER_ROOT . '/' . $appname . '/templates/default'; if (is_dir($tpldir)) { return $tpldir; @@ -423,19 +423,19 @@ } } - function get_image_dir($appname = ""){ + function get_image_dir($appname = ''){ global $phpgw_info; - if ($appname == "") { - $appname = $phpgw_info["flags"]["currentapp"]; + if ($appname == '') { + $appname = $phpgw_info['flags']['currentapp']; } - if (empty($phpgw_info["server"]["template_set"])) { - $phpgw_info["server"]["template_set"] = "default"; + if (empty($phpgw_info['server']['template_set'])) { + $phpgw_info['server']['template_set'] = 'default'; } - $imagedir = PHPGW_SERVER_ROOT . "/" . $appname . "/templates/" - . $phpgw_info["server"]["template_set"] . "/images"; - $imagedir_default = PHPGW_SERVER_ROOT . "/" . $appname . "/templates/default/images"; - $imagedir_olddefault = PHPGW_SERVER_ROOT . "/" . $appname . "/images"; + $imagedir = PHPGW_SERVER_ROOT . '/' . $appname . '/templates/' + . $phpgw_info['server']['template_set'] . '/images'; + $imagedir_default = PHPGW_SERVER_ROOT . '/' . $appname . '/templates/default/images'; + $imagedir_olddefault = PHPGW_SERVER_ROOT . '/' . $appname . '/images'; if (is_dir ($imagedir)){ return $imagedir; @@ -448,25 +448,25 @@ } } - function get_image_path($appname = ""){ + function get_image_path($appname = ''){ global $phpgw_info; - if ($appname == "") { - $appname = $phpgw_info["flags"]["currentapp"]; + if ($appname == '') { + $appname = $phpgw_info['flags']['currentapp']; } - if (empty($phpgw_info["server"]["template_set"])) { - $phpgw_info["server"]["template_set"] = "default"; + if (empty($phpgw_info['server']['template_set'])) { + $phpgw_info['server']['template_set'] = 'default'; } - $imagedir = PHPGW_SERVER_ROOT . "/".$appname."/templates/".$phpgw_info["server"]["template_set"]."/images"; - $imagedir_default = PHPGW_SERVER_ROOT . "/".$appname."/templates/default/images"; - $imagedir_olddefault = PHPGW_SERVER_ROOT . "/".$appname."/images"; + $imagedir = PHPGW_SERVER_ROOT . '/'.$appname.'/templates/'.$phpgw_info['server']['template_set'].'/images'; + $imagedir_default = PHPGW_SERVER_ROOT . '/'.$appname.'/templates/default/images'; + $imagedir_olddefault = PHPGW_SERVER_ROOT . '/'.$appname.'/images'; if (is_dir ($imagedir)){ - return $phpgw_info["server"]["webserver_url"]."/".$appname."/templates/".$phpgw_info["server"]["template_set"]."/images"; + return $phpgw_info['server']['webserver_url'].'/'.$appname.'/templates/'.$phpgw_info['server']['template_set'].'/images'; }elseif (is_dir ($imagedir_default)){ - return $phpgw_info["server"]["webserver_url"]."/".$appname."/templates/default/images"; + return $phpgw_info['server']['webserver_url'].'/'.$appname.'/templates/default/images'; }elseif (is_dir ($imagedir_olddefault)){ - return $phpgw_info["server"]["webserver_url"]."/".$appname."/images"; + return $phpgw_info['server']['webserver_url'].'/'.$appname.'/images'; }else{ return False; } @@ -476,70 +476,70 @@ { global $phpgw_info, $phpgw; - $phpgw_info["navbar"]["home"]["title"] = "Home"; - $phpgw_info["navbar"]["home"]["url"] = $phpgw->link($phpgw_info["server"]["webserver_url"] . "/index.php"); - $phpgw_info["navbar"]["home"]["icon"] = $phpgw_info["server"]["webserver_url"] . "/phpgwapi/templates/" - . $phpgw_info["server"]["template_set"] . "/images/home.gif"; + $phpgw_info['navbar']['home']['title'] = 'Home'; + $phpgw_info['navbar']['home']['url'] = $phpgw->link($phpgw_info['server']['webserver_url'] . '/index.php'); + $phpgw_info['navbar']['home']['icon'] = $phpgw_info['server']['webserver_url'] . '/phpgwapi/templates/' + . $phpgw_info['server']['template_set'] . '/images/home.gif'; - reset($phpgw_info["user"]["apps"]); - while ($permission = each($phpgw_info["user"]["apps"])) { + reset($phpgw_info['user']['apps']); + while ($permission = each($phpgw_info['user']['apps'])) { if (is_long($permission[0])) { continue; } - if ($phpgw_info["apps"][$permission[0]]["status"] != 2) { - $phpgw_info["navbar"][$permission[0]]["title"] = $phpgw_info["apps"][$permission[0]]["title"]; - $phpgw_info["navbar"][$permission[0]]["url"] = $phpgw->link($phpgw_info["server"]["webserver_url"] - . "/" . $permission[0] . "/index.php"); - $icon_file = PHPGW_SERVER_ROOT . "/".$permission[0] . "/templates/". $phpgw_info["server"]["template_set"]. "/images/navbar.gif"; + if ($phpgw_info['apps'][$permission[0]]['status'] != 2) { + $phpgw_info['navbar'][$permission[0]]['title'] = $phpgw_info['apps'][$permission[0]]['title']; + $phpgw_info['navbar'][$permission[0]]['url'] = $phpgw->link($phpgw_info['server']['webserver_url'] + . '/' . $permission[0] . '/index.php'); + $icon_file = PHPGW_SERVER_ROOT . '/'.$permission[0] . '/templates/'. $phpgw_info['server']['template_set']. '/images/navbar.gif'; if (file_exists($icon_file)){ - $phpgw_info["navbar"][$permission[0]]["icon"] = $phpgw_info["server"]["webserver_url"] . "/" - . $permission[0] . "/templates/" . $phpgw_info["server"]["template_set"] . "/images/navbar.gif"; + $phpgw_info['navbar'][$permission[0]]['icon'] = $phpgw_info['server']['webserver_url'] . '/' + . $permission[0] . '/templates/' . $phpgw_info['server']['template_set'] . '/images/navbar.gif'; }else{ - $phpgw_info["navbar"][$permission[0]]["icon"] = $phpgw_info["server"]["webserver_url"] . "/" - . $permission[0] . "/templates/default/images/navbar.gif"; + $phpgw_info['navbar'][$permission[0]]['icon'] = $phpgw_info['server']['webserver_url'] . '/' + . $permission[0] . '/templates/default/images/navbar.gif'; } } } - $phpgw_info["navbar"]["preferences"]["title"] = "preferences"; - $phpgw_info["navbar"]["preferences"]["url"] = $phpgw->link($phpgw_info["server"]["webserver_url"] - . "/preferences/index.php"); - $phpgw_info["navbar"]["preferences"]["icon"] = $phpgw_info["server"]["webserver_url"] . "/preferences/templates/" - . $phpgw_info["server"]["template_set"] . "/images/navbar.gif"; + $phpgw_info['navbar']['preferences']['title'] = 'preferences'; + $phpgw_info['navbar']['preferences']['url'] = $phpgw->link($phpgw_info['server']['webserver_url'] + . '/preferences/index.php'); + $phpgw_info['navbar']['preferences']['icon'] = $phpgw_info['server']['webserver_url'] . '/preferences/templates/' + . $phpgw_info['server']['template_set'] . '/images/navbar.gif'; - if ($phpgw_info["flags"]["currentapp"] == "home" || $phpgw_info["flags"]["currentapp"] == "preferences" || $phpgw_info["flags"]["currentapp"] == "about") { - $app = "phpGroupWare"; + if ($phpgw_info['flags']['currentapp'] == 'home' || $phpgw_info['flags']['currentapp'] == 'preferences' || $phpgw_info['flags']['currentapp'] == 'about') { + $app = 'phpGroupWare'; } else { - $app = $phpgw_info["flags"]["currentapp"]; + $app = $phpgw_info['flags']['currentapp']; } - $phpgw_info["navbar"]["about"]["title"] = lang("About x",$app); // We handle this here + $phpgw_info['navbar']['about']['title'] = lang('About x',$app); // We handle this here // becuase its special - $phpgw_info["navbar"]["about"]["url"] = $phpgw->link($phpgw_info["server"]["webserver_url"] - . "/about.php","app=$app"); - $phpgw_info["navbar"]["about"]["icon"] = $phpgw_info["server"]["webserver_url"] . "/phpgwapi/templates/" - . $phpgw_info["server"]["template_set"] . "/images/about.gif"; + $phpgw_info['navbar']['about']['url'] = $phpgw->link($phpgw_info['server']['webserver_url'] + . '/about.php','app='.$app); + $phpgw_info['navbar']['about']['icon'] = $phpgw_info['server']['webserver_url'] . '/phpgwapi/templates/' + . $phpgw_info['server']['template_set'] . '/images/about.gif'; - $phpgw_info["navbar"]["logout"]["title"] = "Logout"; - $phpgw_info["navbar"]["logout"]["url"] = $phpgw->link($phpgw_info["server"]["webserver_url"] - . "/logout.php"); - $phpgw_info["navbar"]["logout"]["icon"] = $phpgw_info["server"]["webserver_url"] . "/phpgwapi/templates/" - . $phpgw_info["server"]["template_set"] . "/images/logout.gif"; + $phpgw_info['navbar']['logout']['title'] = 'Logout'; + $phpgw_info['navbar']['logout']['url'] = $phpgw->link($phpgw_info['server']['webserver_url'] + . '/logout.php'); + $phpgw_info['navbar']['logout']['icon'] = $phpgw_info['server']['webserver_url'] . '/phpgwapi/templates/' + . $phpgw_info['server']['template_set'] . '/images/logout.gif'; } function app_header() { - if (file_exists(PHPGW_APP_INC . "/header.inc.php")) { - include(PHPGW_APP_INC . "/header.inc.php"); + if (file_exists(PHPGW_APP_INC . '/header.inc.php')) { + include(PHPGW_APP_INC . '/header.inc.php'); } } function phpgw_header() { global $phpgw, $phpgw_info; - include(PHPGW_INCLUDE_ROOT . "/phpgwapi/templates/" . $phpgw_info["server"]["template_set"] - . "/head.inc.php"); + include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $phpgw_info['server']['template_set'] + . '/head.inc.php'); $this->navbar(False); - include(PHPGW_INCLUDE_ROOT . "/phpgwapi/templates/" . $phpgw_info["server"]["template_set"] - . "/navbar.inc.php"); - if ((! isset($phpgw_info["flags"]["nonavbar"]) || ! $phpgw_info["flags"]["nonavbar"]) && ! $phpgw_info["flags"]["navbar_target"]) { + include(PHPGW_INCLUDE_ROOT . '/phpgwapi/templates/' . $phpgw_info['server']['template_set'] + . '/navbar.inc.php'); + if ((! isset($phpgw_info['flags']['nonavbar']) || ! $phpgw_info['flags']['nonavbar']) && ! $phpgw_info['flags']['navbar_target']) { echo parse_navbar(); } } @@ -548,8 +548,8 @@ { global $phpgw, $phpgw_info, $HTMLCOMPLAINT; - if (!isset($phpgw_info["flags"]["nofooter"]) || !$phpgw_info["flags"]["nofooter"]) { - include(PHPGW_API_INC . "/footer.inc.php"); + if (!isset($phpgw_info['flags']['nofooter']) || !$phpgw_info['flags']['nofooter']) { + include(PHPGW_API_INC . '/footer.inc.php'); } // Clean up mcrypt @@ -562,7 +562,7 @@ function hex2bin($data) { $len = strlen($data); - return pack("H" . $len, $data); + return pack('H' . $len, $data); } function encrypt($data) { @@ -605,11 +605,11 @@ { global $phpgw, $phpgw_info; - if ($phpgw_info["server"]["ldap_encryption_type"] == "DES") { + if ($phpgw_info['server']['ldap_encryption_type'] == 'DES') { $salt = $this->randomstring(2); $e_password = $this->des_cryptpasswd($password, $salt); } - if ($phpgw_info["server"]["ldap_encryption_type"] == "MD5") { + if ($phpgw_info['server']['ldap_encryption_type'] == 'MD5') { // $salt = $this->randomstring(9); $salt = $this->randomstring(8); // patch $e_password = $this->md5_cryptpasswd($password, $salt); @@ -617,31 +617,31 @@ return $e_password; } - function hook($location = "", $order = ""){ + function hook($location = '', $order = ''){ global $phpgw, $phpgw_info; - if ($order == ""){$order[] = $phpgw_info["flags"]["currentapp"];} + if ($order == ''){$order[] = $phpgw_info['flags']['currentapp'];} /* First include the ordered apps hook file */ reset ($order); while (list (, $appname) = each ($order)){ - $f = PHPGW_SERVER_ROOT . "/" . $appname . "/inc/hook_".$phpgw_info["flags"]["currentapp"]; - if ($location != "") { - $f .= "_".$location.".inc.php"; + $f = PHPGW_SERVER_ROOT . '/' . $appname . '/inc/hook_'.$phpgw_info['flags']['currentapp']; + if ($location != '') { + $f .= '_'.$location.'.inc.php'; } else { - $f .= ".inc.php"; + $f .= '.inc.php'; } if (file_exists($f)) {include($f);} $completed_hooks[$appname] = True; } /* Then add the rest */ - reset ($phpgw_info["user"]["apps"]); - while ($permission = each($phpgw_info["user"]["apps"])) { + reset ($phpgw_info['user']['apps']); + while ($permission = each($phpgw_info['user']['apps'])) { if ($completed_hooks[$permission[0]] != True){ $appname = $permission[0]; - $f = PHPGW_SERVER_ROOT . "/" . $permission[0] . "/inc/hook_".$phpgw_info["flags"]["currentapp"]; - if ($location != "") { - $f .= "_".$location.".inc.php"; + $f = PHPGW_SERVER_ROOT . '/' . $permission[0] . '/inc/hook_'.$phpgw_info['flags']['currentapp']; + if ($location != '') { + $f .= '_'.$location.'.inc.php'; } else { - $f .= ".inc.php"; + $f .= '.inc.php'; } if (file_exists($f)) { include($f); @@ -650,19 +650,19 @@ } } - function hook_single($location = "", $appname = "") + function hook_single($location = '', $appname = '') { global $phpgw, $phpgw_info; if (! $appname) { - $appname = $phpgw_info["flags"]["currentapp"]; + $appname = $phpgw_info['flags']['currentapp']; } $s = $phpgw->common->filesystem_separator(); /* First include the ordered apps hook file */ - $f = PHPGW_SERVER_ROOT . $s . $appname . $s . "inc" . $s . "hook_".$appname; - if ($location != "") { - $f .= "_".$location.".inc.php"; + $f = PHPGW_SERVER_ROOT . $s . $appname . $s . 'inc' . $s . 'hook_'.$appname; + if ($location != '') { + $f .= '_'.$location.'.inc.php'; } else { - $f .= ".inc.php"; + $f .= '.inc.php'; } if (file_exists($f)) { include($f); @@ -672,39 +672,39 @@ } } - function hook_count($location = ""){ + function hook_count($location = ''){ global $phpgw, $phpgw_info; $count = 0; - reset($phpgw_info["user"]["apps"]); - while ($permission = each($phpgw_info["user"]["apps"])) { - $f = PHPGW_SERVER_ROOT . "/" . $permission[0] . "/inc/hook_".$phpgw_info["flags"]["currentapp"]; - if ($location != ""){$f .= "_".$location.".inc.php";}else{$f .= ".inc.php"; } + reset($phpgw_info['user']['apps']); + while ($permission = each($phpgw_info['user']['apps'])) { + $f = PHPGW_SERVER_ROOT . '/' . $permission[0] . '/inc/hook_'.$phpgw_info['flags']['currentapp']; + if ($location != ''){$f .= '_'.$location.'.inc.php';}else{$f .= '.inc.php'; } if (file_exists($f)) {++$count;} } return $count; } /* Wrapper to the session->appsession() */ - function appsession($data = "##NOTHING##") { + function appsession($data = '##NOTHING##') { global $phpgw_info, $phpgw; return $phpgw->session->appsession($data); } - function show_date($t = "", $format = "") + function show_date($t = '', $format = '') { global $phpgw_info; if (! $t) $t = time(); - $t = $t + ((60*60) * $phpgw_info["user"]["preferences"]["common"]["tz_offset"]); + $t = $t + ((60*60) * $phpgw_info['user']['preferences']['common']['tz_offset']); if (! $format) { - $format = $phpgw_info["user"]["preferences"]["common"]["dateformat"] . " - "; - if ($phpgw_info["user"]["preferences"]["common"]["timeformat"] == "12") { - $format .= "h:i:s a"; + $format = $phpgw_info['user']['preferences']['common']['dateformat'] . ' - '; + if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { + $format .= 'h:i:s a'; } else { - $format .= "H:i:s"; + $format .= 'H:i:s'; } } return date($format,$t); @@ -713,8 +713,8 @@ function dateformatorder($yearstr,$monthstr,$daystr,$add_seperator = False) { global $phpgw_info; - $dateformat = strtolower($phpgw_info["user"]["preferences"]["common"]["dateformat"]); - $sep = substr($phpgw_info["user"]["preferences"]["common"]["dateformat"],1,1); + $dateformat = strtolower($phpgw_info['user']['preferences']['common']['dateformat']); + $sep = substr($phpgw_info['user']['preferences']['common']['dateformat'],1,1); $dlarr[strpos($dateformat,'y')] = $yearstr; $dlarr[strpos($dateformat,'m')] = $monthstr; @@ -724,20 +724,20 @@ if ($add_seperator) { return (implode($sep,$dlarr)); } else { - return (implode(" ",$dlarr)); + return (implode(' ',$dlarr)); } } - function formattime($hour,$min,$sec="") + function formattime($hour,$min,$sec='') { global $phpgw_info; $h12 = $hour; - if ($phpgw_info["user"]["preferences"]["common"]["timeformat"] == "12") { + if ($phpgw_info['user']['preferences']['common']['timeformat'] == '12') { if ($hour > 12) - $ampm = " pm"; + $ampm = ' pm'; else - $ampm = " am"; + $ampm = ' am'; $h12 %= 12; if ($h12 == 0 && $hour) $h12 = 12; @@ -755,99 +755,99 @@ // This will be moved into the applications area. function check_code($code) { - $s = "
"; + $s = '
'; switch ($code) { - case 13: $s .= lang("Your message has been sent");break; - case 14: $s .= lang("New entry added sucessfully");break; - case 15: $s .= lang("Entry updated sucessfully"); break; - case 16: $s .= lang("Entry has been deleted sucessfully"); break; - case 18: $s .= lang("Password has been updated"); break; - case 38: $s .= lang("Password could not be changed"); break; - case 19: $s .= lang("Session has been killed"); break; - case 27: $s .= lang("Account has been updated"); break; - case 28: $s .= lang("Account has been created"); break; - case 29: $s .= lang("Account has been deleted"); break; - case 30: $s .= lang("Your settings have been updated"); break; - case 31: $s .= lang("Group has been added"); break; - case 32: $s .= lang("Group has been deleted"); break; - case 33: $s .= lang("Group has been updated"); break; - case 34: $s .= lang("Account has been deleted") . "

" - . lang("Error deleting x x directory",lang("users")," ".lang("private")." ") - . ",
" . lang("Please x by hand",lang("delete")) . "

" - . lang("To correct this error for the future you will need to properly set the") - . "
" . lang("permissions to the files/users directory") - . "
" . lang("On *nix systems please type: x","chmod 707 " - . $phpgw_info["server"]["files_dir"] . "/users/"); + case 13: $s .= lang('Your message has been sent');break; + case 14: $s .= lang('New entry added sucessfully');break; + case 15: $s .= lang('Entry updated sucessfully'); break; + case 16: $s .= lang('Entry has been deleted sucessfully'); break; + case 18: $s .= lang('Password has been updated'); break; + case 38: $s .= lang('Password could not be changed'); break; + case 19: $s .= lang('Session has been killed'); break; + case 27: $s .= lang('Account has been updated'); break; + case 28: $s .= lang('Account has been created'); break; + case 29: $s .= lang('Account has been deleted'); break; + case 30: $s .= lang('Your settings have been updated'); break; + case 31: $s .= lang('Group has been added'); break; + case 32: $s .= lang('Group has been deleted'); break; + case 33: $s .= lang('Group has been updated'); break; + case 34: $s .= lang('Account has been deleted') . '

' + . lang('Error deleting x x directory',lang('users'),' '.lang('private').' ') + . ',
' . lang('Please x by hand',lang('delete')) . '

' + . lang('To correct this error for the future you will need to properly set the') + . '
' . lang('permissions to the files/users directory') + . '
' . lang('On *nix systems please type: x','chmod 707 ' + . $phpgw_info['server']['files_dir'] . '/users/'); break; - case 35: $s .= lang("Account has been updated") . "

" - . lang("Error renaming x x directory",lang("users"), - " ".lang("private")." ") - . ",
" . lang("Please x by hand", - lang("rename")) . "

" - . lang("To correct this error for the future you will need to properly set the") - . "
" . lang("permissions to the files/users directory") - . "
" . lang("On *nix systems please type: x","chmod 707 " - . $phpgw_info["server"]["files_dir"] . "/users/"); + case 35: $s .= lang('Account has been updated') . '

' + . lang('Error renaming x x directory',lang('users'), + ' '.lang('private').' ') + . ',
' . lang('Please x by hand', + lang('rename')) . '

' + . lang('To correct this error for the future you will need to properly set the') + . '
' . lang('permissions to the files/users directory') + . '
' . lang('On *nix systems please type: x','chmod 707 ' + . $phpgw_info['server']['files_dir'] . '/users/'); break; - case 36: $s .= lang("Account has been created") . "

" - . lang("Error creating x x directory",lang("users"), - " ".lang("private")." ") - . ",
" . lang("Please x by hand", - lang("create")) . "

" - . lang("To correct this error for the future you will need to properly set the") - . "
" . lang("permissions to the files/users directory") - . "
" . lang("On *nix systems please type: x","chmod 707 " - . $phpgw_info["server"]["files_dir"] . "/users/"); + case 36: $s .= lang('Account has been created') . '

' + . lang('Error creating x x directory',lang('users'), + ' '.lang('private').' ') + . ',
' . lang('Please x by hand', + lang('create')) . '

' + . lang('To correct this error for the future you will need to properly set the') + . '
' . lang('permissions to the files/users directory') + . '
' . lang('On *nix systems please type: x','chmod 707 ' + . $phpgw_info['server']['files_dir'] . '/users/'); break; - case 37: $s .= lang("Group has been added") . "

" - . lang("Error creating x x directory",lang("groups")," ") - . ",
" . lang("Please x by hand", - lang("create")) . "

" - . lang("To correct this error for the future you will need to properly set the") - . "
" . lang("permissions to the files/users directory") - . "
" . lang("On *nix systems please type: x","chmod 707 " - . $phpgw_info["server"]["files_dir"] . "/groups/"); + case 37: $s .= lang('Group has been added') . '

' + . lang('Error creating x x directory',lang('groups'),' ') + . ',
' . lang('Please x by hand', + lang('create')) . '

' + . lang('To correct this error for the future you will need to properly set the') + . '
' . lang('permissions to the files/users directory') + . '
' . lang('On *nix systems please type: x','chmod 707 ' + . $phpgw_info['server']['files_dir'] . '/groups/'); break; - case 38: $s .= lang("Group has been deleted") . "

" - . lang("Error deleting x x directory",lang("groups")," ") - . ",
" . lang("Please x by hand", - lang("delete")) . "

" - . lang("To correct this error for the future you will need to properly set the") - . "
" . lang("permissions to the files/users directory") - . "
" . lang("On *nix systems please type: x","chmod 707 " - . $phpgw_info["server"]["files_dir"] . "/groups/"); + case 38: $s .= lang('Group has been deleted') . '

' + . lang('Error deleting x x directory',lang('groups'),' ') + . ',
' . lang('Please x by hand', + lang('delete')) . '

' + . lang('To correct this error for the future you will need to properly set the') + . '
' . lang('permissions to the files/users directory') + . '
' . lang('On *nix systems please type: x','chmod 707 ' + . $phpgw_info['server']['files_dir'] . '/groups/'); break; - case 39: $s .= lang("Group has been updated") . "

" - . lang("Error renaming x x directory",lang("groups")," ") - . ",
" . lang("Please x by hand", - lang("rename")) . "

" - . lang("To correct this error for the future you will need to properly set the") - . "
" . lang("permissions to the files/users directory") - . "
" . lang("On *nix systems please type: x","chmod 707 " - . $phpgw_info["server"]["files_dir"] . "/groups/"); + case 39: $s .= lang('Group has been updated') . '

' + . lang('Error renaming x x directory',lang('groups'),' ') + . ',
' . lang('Please x by hand', + lang('rename')) . '

' + . lang('To correct this error for the future you will need to properly set the') + . '
' . lang('permissions to the files/users directory') + . '
' . lang('On *nix systems please type: x','chmod 707 ' + . $phpgw_info['server']['files_dir'] . '/groups/'); break; - case 40: $s .= lang("You have not entered a\nBrief Description")."."; + case 40: $s .= lang('You have not entered a\nBrief Description').'.'; break; - case 41: $s .= lang("You have not entered a\nvalid time of day."); + case 41: $s .= lang('You have not entered a\nvalid time of day.'); break; - case 42: $s .= lang("You have not entered a\nvalid date."); + case 42: $s .= lang('You have not entered a\nvalid date.'); break; - default: return ""; + default: return ''; } return $s; } - function phpgw_error($error,$line = "", $file = "") + function phpgw_error($error,$line = '', $file = '') { - echo "

phpGroupWare internal error:

$error"; + echo '

phpGroupWare internal error:

'.$error; if ($line) { - echo "Line: $line"; + echo 'Line: '.$line; } if ($file) { - echo "File: $file"; + echo 'File: '.$file; } - echo "

Your session has been halted."; + echo '

Your session has been halted.'; exit; } @@ -912,10 +912,10 @@ // This will return a list of functions in the API function debug_list_core_functions() { - echo "
core functions
"; - echo "

";
-       chdir(PHPGW_INCLUDE_ROOT . "/phpgwapi");
+       echo '
core functions
'; + echo '
';
+       chdir(PHPGW_INCLUDE_ROOT . '/phpgwapi');
        system("grep -r '^[ \t]*function' *");
-       echo "
"; + echo '
'; } }//end common class diff --git a/phpgwapi/inc/class.contacts.inc.php b/phpgwapi/inc/class.contacts.inc.php index abbfecfedd..6b59e7ac5f 100644 --- a/phpgwapi/inc/class.contacts.inc.php +++ b/phpgwapi/inc/class.contacts.inc.php @@ -1,4 +1,4 @@ diff --git a/phpgwapi/inc/class.crypto.inc.php b/phpgwapi/inc/class.crypto.inc.php index 8e20cd7b2d..5f5f2801b1 100644 --- a/phpgwapi/inc/class.crypto.inc.php +++ b/phpgwapi/inc/class.crypto.inc.php @@ -32,10 +32,10 @@ global $phpgw, $phpgw_info; $key = $vars[0]; $iv = $vars[1]; - if ($phpgw_info["server"]["mcrypt_enabled"] && extension_loaded("mcrypt")) { - if ($phpgw_info["server"]["versions"]["mcrypt"] == "old") { + if ($phpgw_info['server']['mcrypt_enabled'] && extension_loaded('mcrypt')) { + if ($phpgw_info['server']['versions']['mcrypt'] == 'old') { $this->td = false; - if (PHP_VERSION > "4.0.2pl1") { + if (PHP_VERSION > '4.0.2pl1') { $keysize = mcrypt_get_key_size(MCRYPT_TRIPLEDES); $ivsize = mcrypt_get_iv_size(MCRYPT_TRIPLEDES,MCRYPT_MODE_CBC); } else { @@ -44,7 +44,7 @@ } } else { // Start up mcrypt - $this->td = mcrypt_module_open (MCRYPT_TRIPLEDES, "", MCRYPT_MODE_CBC, ""); + $this->td = mcrypt_module_open (MCRYPT_TRIPLEDES, '', MCRYPT_MODE_CBC, ''); $ivsize = mcrypt_enc_get_iv_size($this->td); $keysize = mcrypt_enc_get_key_size($this->td); @@ -62,7 +62,7 @@ for ($i = 0; $i < $keysize; $i++) { $this->key .= $key[$i % $x]; } - if ($phpgw_info["server"]["versions"]["mcrypt"] != "old") { + if ($phpgw_info['server']['versions']['mcrypt'] != 'old') { mcrypt_generic_init ($this->td, $this->key, $this->iv); } } @@ -73,8 +73,8 @@ { global $phpgw_info; - if ($phpgw_info["server"]["mcrypt_enabled"] && extension_loaded("mcrypt")) { - if ($phpgw_info["server"]["versions"]["mcrypt"] != "old") { + if ($phpgw_info['server']['mcrypt_enabled'] && extension_loaded('mcrypt')) { + if ($phpgw_info['server']['versions']['mcrypt'] != 'old') { mcrypt_generic_end ($this->td); } } @@ -82,7 +82,7 @@ function hex2bin($data) { $len = strlen($data); - return pack("H" . $len, $data); + return pack('H' . $len, $data); } function encrypt($data) { @@ -91,10 +91,10 @@ $data = serialize($data); // Disable all encryption if the admin didn't set it up - if ($phpgw_info["server"]["mcrypt_enabled"] && extension_loaded("mcrypt")) { - switch ($phpgw_info["server"]["versions"]["mcrypt"]) { + if ($phpgw_info['server']['mcrypt_enabled'] && extension_loaded('mcrypt')) { + switch ($phpgw_info['server']['versions']['mcrypt']) { // The old code, only works with mcrypt <= 2.2.x - case "old": { + case 'old': { $encrypteddata = mcrypt_cbc(MCRYPT_TripleDES, $this->key, $data, MCRYPT_ENCRYPT); break; } @@ -113,12 +113,12 @@ global $phpgw_info; // Disable all encryption if the admin didn't set it up - if ($phpgw_info["server"]["mcrypt_enabled"] && extension_loaded("mcrypt")) { + if ($phpgw_info['server']['mcrypt_enabled'] && extension_loaded('mcrypt')) { $data = $this->hex2bin($encrypteddata); - switch ($phpgw_info["server"]["versions"]["mcrypt"]) { + switch ($phpgw_info['server']['versions']['mcrypt']) { // The old code, only works with mcrypt <= 2.2.x - case "old": { + case 'old': { $data = mcrypt_cbc(MCRYPT_TripleDES, $this->key, $data, MCRYPT_DECRYPT); break; }
 ' . $fs . $tab[1]["label"] + . $tab[1]['link'] . '" class="tablink">' . $fs . $tab[1]['label'] . $fse . '  ' . $fs . $tab[1]["label"] . $fse + . $tab[1]['link'] . '" class="tablink">' . $fs . $tab[1]['label'] . $fse . '