mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
intval() -> (int)
This commit is contained in:
parent
94de0f5725
commit
5794ca4cc1
@ -121,8 +121,8 @@
|
||||
function return_array($type,$start,$limit = True,$query = '',$sort = '',$order = '',$globals = False, $parent_id = '', $lastmod = -1, $column = '')
|
||||
{
|
||||
//casting and addslashes for security
|
||||
$start = intval($start);
|
||||
$parent_id = intval($parent_id);
|
||||
$start = (int)$start;
|
||||
$parent_id = (int)$parent_id;
|
||||
$query = $this->db->db_addslashes($query);
|
||||
$sort = $this->db->db_addslashes($sort);
|
||||
$order = $this->db->db_addslashes($order);
|
||||
@ -255,11 +255,11 @@
|
||||
function return_sorted_array($start,$limit = True,$query = '',$sort = '',$order = '',$globals = False, $parent_id = '')
|
||||
{
|
||||
//casting and slashes for security
|
||||
$start = intval($start);
|
||||
$start = (int)$start;
|
||||
$query = $this->db->db_addslashes($query);
|
||||
$sort = $this->db->db_addslashes($sort);
|
||||
$order = $this->db->db_addslashes($order);
|
||||
$parent_id = intval($parent_id);
|
||||
$parent_id = (int)$parent_id;
|
||||
|
||||
if ($globals)
|
||||
{
|
||||
@ -407,7 +407,7 @@
|
||||
*/
|
||||
function return_single($id = '')
|
||||
{
|
||||
$this->db->query('SELECT * FROM phpgw_categories WHERE cat_id=' . intval($id),__LINE__,__FILE__);
|
||||
$this->db->query('SELECT * FROM phpgw_categories WHERE cat_id=' . (int)$id,__LINE__,__FILE__);
|
||||
|
||||
if ($this->db->next_record())
|
||||
{
|
||||
@ -553,8 +553,8 @@
|
||||
*/
|
||||
function add($values)
|
||||
{
|
||||
$values['id'] = intval($values['id']);
|
||||
$values['parent'] = intval($values['parent']);
|
||||
$values['id'] = (int)$values['id'];
|
||||
$values['parent'] = (int)$values['parent'];
|
||||
|
||||
if ($values['parent'] > 0)
|
||||
{
|
||||
@ -571,9 +571,9 @@
|
||||
}
|
||||
|
||||
$this->db->query('INSERT INTO phpgw_categories (' . $id_col . 'cat_parent,cat_owner,cat_access,cat_appname,cat_name,cat_description,cat_data,'
|
||||
. 'cat_main,cat_level, last_mod) VALUES (' . $id_val . intval($values['parent']) . ',' . $this->account_id . ",'" . $values['access']
|
||||
. 'cat_main,cat_level, last_mod) VALUES (' . $id_val . (int)$values['parent'] . ',' . $this->account_id . ",'" . $values['access']
|
||||
. "','" . $this->app_name . "','" . $values['name'] . "','" . $values['descr'] . "','" . $values['data']
|
||||
. "'," . intval($values['main']) . ',' . intval($values['level']) . ',' . time() . ')',__LINE__,__FILE__);
|
||||
. "'," . (int)$values['main'] . ',' . (int)$values['level'] . ',' . time() . ')',__LINE__,__FILE__);
|
||||
|
||||
if ($values['id'] > 0)
|
||||
{
|
||||
@ -584,7 +584,7 @@
|
||||
$max = $this->db->get_last_insert_id('phpgw_categories','cat_id');
|
||||
}
|
||||
|
||||
$max = intval($max);
|
||||
$max = (int)$max;
|
||||
if ($values['parent'] == 0)
|
||||
{
|
||||
$this->db->query('UPDATE phpgw_categories SET cat_main=' . $max . ' WHERE cat_id=' . $max,__LINE__,__FILE__);
|
||||
@ -599,7 +599,7 @@
|
||||
*/
|
||||
/*function delete($cat_id,$subs = False)
|
||||
{
|
||||
$cat_id = intval($cat_id);
|
||||
$cat_id = (int)$cat_id;
|
||||
if ($subs)
|
||||
{
|
||||
$subdelete = ' OR cat_parent=' . $cat_id . ' OR cat_main=' . $cat_id;
|
||||
@ -611,7 +611,7 @@
|
||||
|
||||
function delete($cat_id, $drop_subs = False, $modify_subs = False)
|
||||
{
|
||||
$cat_id = intval($cat_id);
|
||||
$cat_id = (int)$cat_id;
|
||||
if ($drop_subs)
|
||||
{
|
||||
$subdelete = ' OR cat_parent=' . $cat_id . ' OR cat_main=' . $cat_id;
|
||||
@ -627,8 +627,8 @@
|
||||
{
|
||||
if ($cats[$i]['level'] == 1)
|
||||
{
|
||||
$this->db->query('UPDATE phpgw_categories set cat_level=0, cat_parent=0, cat_main=' . intval($cats[$i]['id'])
|
||||
. ' WHERE cat_id=' . intval($cats[$i]['id']) . " AND cat_appname='" . $this->app_name . "'",__LINE__,__FILE__);
|
||||
$this->db->query('UPDATE phpgw_categories set cat_level=0, cat_parent=0, cat_main=' . (int)$cats[$i]['id']
|
||||
. ' WHERE cat_id=' . (int)$cats[$i]['id'] . " AND cat_appname='" . $this->app_name . "'",__LINE__,__FILE__);
|
||||
$new_main = $cats[$i]['id'];
|
||||
}
|
||||
else
|
||||
@ -644,7 +644,7 @@
|
||||
}
|
||||
|
||||
$this->db->query('UPDATE phpgw_categories set cat_level=' . ($cats[$i]['level']-1) . $update_main . $update_parent
|
||||
. ' WHERE cat_id=' . intval($cats[$i]['id']) . " AND cat_appname='" . $this->app_name . "'",__LINE__,__FILE__);
|
||||
. ' WHERE cat_id=' . (int)$cats[$i]['id'] . " AND cat_appname='" . $this->app_name . "'",__LINE__,__FILE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -663,10 +663,10 @@
|
||||
*/
|
||||
function edit($values)
|
||||
{
|
||||
$values['id'] = intval($values['id']);
|
||||
$values['parent'] = intval($values['parent']);
|
||||
$values['id'] = (int)$values['id'];
|
||||
$values['parent'] = (int)$values['parent'];
|
||||
|
||||
if (isset($values['old_parent']) && intval($values['old_parent']) != $values['parent'])
|
||||
if (isset($values['old_parent']) && (int)$values['old_parent'] != $values['parent'])
|
||||
{
|
||||
$this->delete($values['id'],False,True);
|
||||
return $this->add($values);
|
||||
@ -675,8 +675,8 @@
|
||||
{
|
||||
if ($values['parent'] > 0)
|
||||
{
|
||||
$values['main'] = intval($this->id2name($values['parent'],'main'));
|
||||
$values['level'] = intval($this->id2name($values['parent'],'level')+1);
|
||||
$values['main'] = (int)$this->id2name($values['parent'],'main');
|
||||
$values['level'] = (int)$this->id2name($values['parent'],'level' + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -714,7 +714,7 @@
|
||||
|
||||
function id2name($cat_id = '', $item = 'name')
|
||||
{
|
||||
$cat_id = intval($cat_id);
|
||||
$cat_id = (int)$cat_id;
|
||||
if ($cat_id == 0)
|
||||
{
|
||||
return '--';
|
||||
@ -765,7 +765,7 @@
|
||||
*/
|
||||
function exists($type,$cat_name = '',$cat_id = '')
|
||||
{
|
||||
$cat_id = intval($cat_id);
|
||||
$cat_id = (int)$cat_id;
|
||||
$filter = $this->filter($type);
|
||||
|
||||
if ($cat_name)
|
||||
|
@ -51,7 +51,7 @@
|
||||
|
||||
function datetime()
|
||||
{
|
||||
$this->tz_offset = 3600 * intval(@$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset']);
|
||||
$this->tz_offset = 3600 * (int)@$GLOBALS['phpgw_info']['user']['preferences']['common']['tz_offset'];
|
||||
print_debug('datetime::datetime::gmtnow',$this->gmtnow,'api');
|
||||
|
||||
$error_occured = True;
|
||||
@ -60,7 +60,7 @@
|
||||
{
|
||||
if(isset($GLOBALS['phpgw_info']['server']['tz_offset']))
|
||||
{
|
||||
$this->gmtnow = time() - (intval($GLOBALS['phpgw_info']['server']['tz_offset']) * 3600);
|
||||
$this->gmtnow = time() - ((int)$GLOBALS['phpgw_info']['server']['tz_offset'] * 3600);
|
||||
//echo "<p>set via tz_offset=".$GLOBALS['phpgw_info']['server']['tz_offset'].": gmtnow=".date('Y/m/d H:i',$this->gmtnow)."</p>\n";
|
||||
}
|
||||
else
|
||||
@ -71,7 +71,7 @@
|
||||
}
|
||||
$this->users_localtime = time() + $this->tz_offset;
|
||||
}
|
||||
|
||||
|
||||
function getntpoffset()
|
||||
{
|
||||
$error_occured = False;
|
||||
@ -99,7 +99,7 @@
|
||||
{
|
||||
$date = explode('-',$array[1]);
|
||||
$time = explode(':',$array[2]);
|
||||
$this->gmtnow = mktime(intval($time[0]),intval($time[1]),intval($time[2]),intval($date[1]),intval($date[2]),intval($date[0]) + 2000);
|
||||
$this->gmtnow = mktime((int)$time[0],(int)$time[1],(int)$time[2],(int)$date[1],(int)$date[2],(int)$date[0] + 2000);
|
||||
print_debug('Temporary RFC epoch',$this->gmtnow,'api');
|
||||
print_debug('GMT',date('Ymd H:i:s',$this->gmtnow),'api');
|
||||
}
|
||||
@ -108,14 +108,14 @@
|
||||
{
|
||||
$error_occured = True;
|
||||
}
|
||||
|
||||
|
||||
if($error_occured == True)
|
||||
{
|
||||
return $this->getbestguess();
|
||||
}
|
||||
else
|
||||
{
|
||||
return intval(($server_time - $this->gmtnow) / 3600);
|
||||
return (int)($server_time - $this->gmtnow / 3600);
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@
|
||||
print_debug('this->gmtnow',$this->gmtnow,'api');
|
||||
print_debug('server time',$server_time,'api');
|
||||
print_debug('server DateTime',date('D, d M Y H:i:s',$server_time),'api');
|
||||
return intval(($server_time - $this->gmtnow) / 3600);
|
||||
return (int)($server_time - $this->gmtnow / 3600);
|
||||
}
|
||||
|
||||
function getbestguess()
|
||||
@ -156,7 +156,7 @@
|
||||
// If DST, add 1 hour...
|
||||
// - (date('I') == 1?3600:0)
|
||||
$this->gmtnow = $this->convert_rfc_to_epoch(gmdate('D, d M Y H:i:s',$server_time).' GMT');
|
||||
return intval(($server_time - $this->gmtnow) / 3600);
|
||||
return (int)($server_time - $this->gmtnow / 3600);
|
||||
}
|
||||
|
||||
function convert_rfc_to_epoch($date_str)
|
||||
@ -192,8 +192,8 @@
|
||||
if(substr($dta[5],0,3) <> 'GMT')
|
||||
{
|
||||
$tzoffset = substr($dta[5],0,1);
|
||||
$tzhours = intval(substr($dta[5],1,2));
|
||||
$tzmins = intval(substr($dta[5],3,2));
|
||||
$tzhours = (int)substr($dta[5],1,2);
|
||||
$tzmins = (int)substr($dta[5],3,2);
|
||||
switch ($tzoffset)
|
||||
{
|
||||
case '-':
|
||||
@ -280,7 +280,7 @@
|
||||
|
||||
function is_leap_year($year)
|
||||
{
|
||||
if ((intval($year) % 4 == 0) && (intval($year) % 100 != 0) || (intval($year) % 400 == 0))
|
||||
if (((int)$year % 4 == 0) && ((int)$year % 100 != 0) || ((int)$year % 400 == 0))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@ -293,38 +293,38 @@
|
||||
function days_in_month($month,$year)
|
||||
{
|
||||
$days = Array(
|
||||
1 => 31,
|
||||
2 => 28 + $this->is_leap_year(intval($year)),
|
||||
3 => 31,
|
||||
4 => 30,
|
||||
5 => 31,
|
||||
6 => 30,
|
||||
7 => 31,
|
||||
8 => 31,
|
||||
9 => 30,
|
||||
10 => 31,
|
||||
11 => 30,
|
||||
12 => 31
|
||||
1 => 31,
|
||||
2 => 28 + $this->is_leap_year((int)$year),
|
||||
3 => 31,
|
||||
4 => 30,
|
||||
5 => 31,
|
||||
6 => 30,
|
||||
7 => 31,
|
||||
8 => 31,
|
||||
9 => 30,
|
||||
10 => 31,
|
||||
11 => 30,
|
||||
12 => 31
|
||||
);
|
||||
return $days[intval($month)];
|
||||
return $days[(int)$month];
|
||||
}
|
||||
|
||||
function date_valid($year,$month,$day)
|
||||
{
|
||||
return checkdate(intval($month),intval($day),intval($year));
|
||||
return checkdate((int)$month,(int)$day,(int)$year);
|
||||
}
|
||||
|
||||
function time_valid($hour,$minutes,$seconds)
|
||||
{
|
||||
if(intval($hour) < 0 || intval($hour) > 24)
|
||||
if((int)$hour < 0 || (int)$hour > 24)
|
||||
{
|
||||
return False;
|
||||
}
|
||||
if(intval($minutes) < 0 || intval($minutes) > 59)
|
||||
if((int)$minutes < 0 || (int)$minutes > 59)
|
||||
{
|
||||
return False;
|
||||
}
|
||||
if(intval($seconds) < 0 || intval($seconds) > 59)
|
||||
if((int)$seconds < 0 || (int)$seconds > 59)
|
||||
{
|
||||
return False;
|
||||
}
|
||||
@ -346,7 +346,7 @@
|
||||
$day = (floor((13 * $month - 1) / 5) + $day + ($year % 100) + floor(($year % 100) / 4) + floor(($year / 100) / 4) - 2 * floor($year / 100) + 77);
|
||||
return (($day - 7 * floor($day / 7)));
|
||||
}
|
||||
|
||||
|
||||
function day_of_year($year,$month,$day)
|
||||
{
|
||||
$days = array(0,31,59,90,120,151,181,212,243,273,304,334);
|
||||
@ -369,13 +369,13 @@
|
||||
*/
|
||||
function days_between($m1,$d1,$y1,$m2,$d2,$y2)
|
||||
{
|
||||
return intval((mktime(0,0,0,$m2,$d2,$y2,0) - mktime(0,0,0,$m1,$d1,$y1,0)) / 86400);
|
||||
return (int)(mktime(0,0,0,$m2,$d2,$y2,0) - mktime(0,0,0,$m1,$d1,$y1,0) / 86400);
|
||||
}
|
||||
|
||||
function date_compare($a_year,$a_month,$a_day,$b_year,$b_month,$b_day)
|
||||
{
|
||||
$a_date = mktime(0,0,0,intval($a_month),intval($a_day),intval($a_year));
|
||||
$b_date = mktime(0,0,0,intval($b_month),intval($b_day),intval($b_year));
|
||||
$a_date = mktime(0,0,0,(int)$a_month,(int)$a_day,(int)$a_year);
|
||||
$b_date = mktime(0,0,0,(int)$b_month,(int)$b_day,(int)$b_year);
|
||||
if($a_date == $b_date)
|
||||
{
|
||||
return 0;
|
||||
@ -394,8 +394,8 @@
|
||||
{
|
||||
// I use the 1970/1/2 to compare the times, as the 1. can get via TZ-offest still
|
||||
// before 1970/1/1, which is the earliest date allowed on windows
|
||||
$a_time = mktime(intval($a_hour),intval($a_minute),intval($a_second),1,2,1970);
|
||||
$b_time = mktime(intval($b_hour),intval($b_minute),intval($b_second),1,2,1970);
|
||||
$a_time = mktime((int)$a_hour,(int)$a_minute,(int)$a_second,1,2,1970);
|
||||
$b_time = mktime((int)$b_hour,(int)$b_minute,(int)$b_second,1,2,1970);
|
||||
if($a_time == $b_time)
|
||||
{
|
||||
return 0;
|
||||
@ -419,16 +419,16 @@
|
||||
{
|
||||
$date = Array('raw','day','month','year','full','dow','dm','bd');
|
||||
$date['raw'] = $localtime;
|
||||
$date['year'] = intval($GLOBALS['phpgw']->common->show_date($date['raw'],'Y'));
|
||||
$date['month'] = intval($GLOBALS['phpgw']->common->show_date($date['raw'],'m'));
|
||||
$date['day'] = intval($GLOBALS['phpgw']->common->show_date($date['raw'],'d'));
|
||||
$date['full'] = intval($GLOBALS['phpgw']->common->show_date($date['raw'],'Ymd'));
|
||||
$date['year'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'Y');
|
||||
$date['month'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'m');
|
||||
$date['day'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'d');
|
||||
$date['full'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'Ymd');
|
||||
$date['bd'] = mktime(0,0,0,$date['month'],$date['day'],$date['year']);
|
||||
$date['dm'] = intval($GLOBALS['phpgw']->common->show_date($date['raw'],'dm'));
|
||||
$date['dm'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'dm');
|
||||
$date['dow'] = $this->day_of_week($date['year'],$date['month'],$date['day']);
|
||||
$date['hour'] = intval($GLOBALS['phpgw']->common->show_date($date['raw'],'H'));
|
||||
$date['minute'] = intval($GLOBALS['phpgw']->common->show_date($date['raw'],'i'));
|
||||
$date['second'] = intval($GLOBALS['phpgw']->common->show_date($date['raw'],'s'));
|
||||
$date['hour'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'H');
|
||||
$date['minute'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'i');
|
||||
$date['second'] = (int)$GLOBALS['phpgw']->common->show_date($date['raw'],'s');
|
||||
|
||||
return $date;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@
|
||||
var $forced = array();
|
||||
/*! @var db */
|
||||
var $db;
|
||||
|
||||
|
||||
var $values,$vars; // standard notify substitues, will be set by standard_substitues()
|
||||
|
||||
/**************************************************************************\
|
||||
@ -200,7 +200,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
$arr[$key] = stripslashes($value);
|
||||
$arr[$key] = stripslashes($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -213,8 +213,8 @@
|
||||
*/
|
||||
function read_repository()
|
||||
{
|
||||
$this->db->query("SELECT * FROM phpgw_preferences".
|
||||
" WHERE preference_owner IN (-1,-2,".intval($this->account_id).")",__LINE__,__FILE__);
|
||||
$this->db->query("SELECT * FROM phpgw_preferences"
|
||||
. " WHERE preference_owner IN (-1,-2," . (int)$this->account_id . ')',__LINE__,__FILE__);
|
||||
|
||||
$this->forced = $this->default = $this->user = array();
|
||||
while($this->db->next_record())
|
||||
@ -266,7 +266,7 @@
|
||||
// setup the standard substitues and substitues the data in $this->data
|
||||
//
|
||||
$this->standard_substitutes();
|
||||
|
||||
|
||||
// This is to supress warnings durring login
|
||||
if (is_array($this->data))
|
||||
{
|
||||
@ -327,7 +327,7 @@
|
||||
case 'default':
|
||||
$this->default[$app_name][$var] = $value;
|
||||
if ((!isset($this->forced[$app_name][$var]) || $this->forced[$app_name][$var] === '') &&
|
||||
(!isset($this->user[$app_name][$var]) || $this->user[$app_name][$var] === ''))
|
||||
(!isset($this->user[$app_name][$var]) || $this->user[$app_name][$var] === ''))
|
||||
{
|
||||
$this->data[$app_name][$var] = $value;
|
||||
}
|
||||
@ -493,7 +493,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
@function save_repository
|
||||
@abstract save the the preferences to the repository
|
||||
@ -515,7 +515,7 @@
|
||||
$prefs = &$this->default;
|
||||
break;
|
||||
default:
|
||||
$account_id = intval($this->account_id);
|
||||
$account_id = (int)$this->account_id;
|
||||
$prefs = &$this->user; // we use the user-array as data contains default values too
|
||||
break;
|
||||
}
|
||||
@ -524,8 +524,9 @@
|
||||
if (! $GLOBALS['phpgw']->acl->check('session_only_preferences',1,'preferences'))
|
||||
{
|
||||
$this->db->transaction_begin();
|
||||
$this->db->query("delete from phpgw_preferences where preference_owner='$account_id'",
|
||||
__LINE__,__FILE__);
|
||||
$this->db->query("DELETE FROM phpgw_preferences WHERE preference_owner='$account_id'",
|
||||
__LINE__,__FILE__
|
||||
);
|
||||
|
||||
foreach($prefs as $app => $value)
|
||||
{
|
||||
@ -534,9 +535,9 @@
|
||||
$value = addslashes(serialize($value)); // this addslashes is for the database
|
||||
$app = $this->db->db_addslashes($app);
|
||||
|
||||
$this->db->query($sql = "INSERT INTO phpgw_preferences".
|
||||
" (preference_owner,preference_app,preference_value)".
|
||||
" VALUES ($account_id,'$app','$value')",__LINE__,__FILE__);
|
||||
$this->db->query($sql = "INSERT INTO phpgw_preferences"
|
||||
. " (preference_owner,preference_app,preference_value)"
|
||||
. " VALUES ($account_id,'$app','$value')",__LINE__,__FILE__);
|
||||
}
|
||||
$this->db->transaction_commit();
|
||||
}
|
||||
@ -551,7 +552,7 @@
|
||||
$GLOBALS['phpgw']->session->delete_cache($this->account_id);
|
||||
$GLOBALS['phpgw']->session->read_repositories(False);
|
||||
}
|
||||
|
||||
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
@ -572,12 +573,11 @@
|
||||
$this->db->query("insert into phpgw_preferences values ('$account_id','"
|
||||
. $this->db->f('preference_value') . "')",__LINE__,__FILE__);
|
||||
}
|
||||
|
||||
|
||||
if ($GLOBALS['phpgw_info']['server']['cache_phpgw_info'] && $account_id == $GLOBALS['phpgw_info']['user']['account_id'])
|
||||
{
|
||||
$GLOBALS['phpgw']->session->read_repositories(False);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -616,11 +616,11 @@
|
||||
*/
|
||||
function verify_basic_settings()
|
||||
{
|
||||
if (gettype($GLOBALS['phpgw_info']['user']['preferences']) != 'array')
|
||||
if (!@is_array($GLOBALS['phpgw_info']['user']['preferences']))
|
||||
{
|
||||
$GLOBALS['phpgw_info']['user']['preferences'] = array();
|
||||
$GLOBALS['phpgw_info']['user']['preferences'] = array();
|
||||
}
|
||||
/* This takes care of new users who dont have proper default prefs setup */
|
||||
/* This takes care of new users who don't have proper default prefs setup */
|
||||
if (!isset($GLOBALS['phpgw_info']['flags']['nocommon_preferences']) ||
|
||||
!$GLOBALS['phpgw_info']['flags']['nocommon_preferences'])
|
||||
{
|
||||
@ -692,8 +692,8 @@
|
||||
function sub_get_mailsvr_port($prefs, $acctnum=0)
|
||||
{
|
||||
// first we try the port number supplied in preferences
|
||||
if ( (isset($prefs['email']['accounts'][$acctnum]['mail_port']))
|
||||
&& ($prefs['email']['accounts'][$acctnum]['mail_port'] != '') )
|
||||
if((isset($prefs['email']['accounts'][$acctnum]['mail_port'])) &&
|
||||
($prefs['email']['accounts'][$acctnum]['mail_port'] != ''))
|
||||
{
|
||||
$port_number = $prefs['email']['accounts'][$acctnum]['mail_port'];
|
||||
}
|
||||
@ -704,7 +704,7 @@
|
||||
{
|
||||
$prefs['email']['accounts'][$acctnum]['mail_server_type'] = $prefs['email']['mail_server_type'];
|
||||
}
|
||||
|
||||
|
||||
switch($prefs['email']['accounts'][$acctnum]['mail_server_type'])
|
||||
{
|
||||
case 'pop3s':
|
||||
@ -882,7 +882,7 @@
|
||||
// a custom email preference. Currently, we simply use standard port numbers
|
||||
// for the service in question.
|
||||
$prefs['email']['mail_port'] = $this->sub_get_mailsvr_port($prefs);
|
||||
|
||||
|
||||
//--- [email][fullname] ---
|
||||
// we pick this up from phpgw api for the default account
|
||||
// the user does not directly manipulate this pref for the default email account
|
||||
@ -890,8 +890,7 @@
|
||||
{
|
||||
$prefs['email']['fullname'] = $GLOBALS['phpgw_info']['user']['fullname'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
// = = = = SIMPLER PREFS = = = =
|
||||
|
||||
// Default Preferences info that is articulated in the email prefs schema array itself
|
||||
@ -1099,7 +1098,7 @@
|
||||
}
|
||||
|
||||
/*
|
||||
// ==== DEPRECIATED - ARCHIVAL CODE ====
|
||||
// ==== DEPRECATED - ARCHIVAL CODE ====
|
||||
// used to be part of function this->create_email_preferences()
|
||||
// = = = = SIMPLER PREFS = = = =
|
||||
// Default Preferences info that is:
|
||||
|
@ -134,7 +134,6 @@
|
||||
*/
|
||||
function sessions_()
|
||||
{
|
||||
|
||||
$this->db = $GLOBALS['phpgw']->db;
|
||||
$this->sessionid = get_var('sessionid',array('GET','COOKIE'));
|
||||
$this->kp3 = get_var('kp3',array('GET','COOKIE'));
|
||||
@ -587,7 +586,7 @@
|
||||
$this->appsession('account_previous_login','phpgwapi',$GLOBALS['phpgw']->auth->previous_login);
|
||||
$GLOBALS['phpgw']->auth->update_lastlogin($this->account_id,$user_ip);
|
||||
$GLOBALS['phpgw']->db->transaction_commit();
|
||||
|
||||
|
||||
//if (!$this->sessionid) echo "<p>session::create(login='$login') = '$this->sessionid': lid='$this->account_lid', domain='$this->account_domain'</p>\n";
|
||||
|
||||
return $this->sessionid;
|
||||
@ -607,19 +606,19 @@
|
||||
|
||||
if ($login != '')
|
||||
{
|
||||
$GLOBALS['phpgw']->db->query('INSERT INTO phpgw_access_log(sessionid,loginid,ip,li,lo,account_id)'.
|
||||
" VALUES ('" . $sessionid . "','" . $this->db->db_addslashes($login). "','" .
|
||||
$this->db->db_addslashes($user_ip) . "',$now,0,".intval($account_id).")",__LINE__,__FILE__);
|
||||
$GLOBALS['phpgw']->db->query('INSERT INTO phpgw_access_log(sessionid,loginid,ip,li,lo,account_id)'
|
||||
. " VALUES ('" . $sessionid . "','" . $this->db->db_addslashes($login). "','"
|
||||
. $this->db->db_addslashes($user_ip) . "',$now,0," . (int)$account_id .')',__LINE__,__FILE__);
|
||||
}
|
||||
else
|
||||
{
|
||||
$GLOBALS['phpgw']->db->query("UPDATE phpgw_access_log SET lo=" . $now . " WHERE sessionid='" .
|
||||
$sessionid . "'",__LINE__,__FILE__);
|
||||
$GLOBALS['phpgw']->db->query("UPDATE phpgw_access_log SET lo=" . $now . " WHERE sessionid='"
|
||||
. $sessionid . "'",__LINE__,__FILE__);
|
||||
}
|
||||
if ($GLOBALS['phpgw_info']['server']['max_access_log_age'])
|
||||
{
|
||||
$max_age = $now - $GLOBALS['phpgw_info']['server']['max_access_log_age'] * 24 * 60 * 60;
|
||||
|
||||
|
||||
$GLOBALS['phpgw']->db->query("DELETE FROM phpgw_access_log WHERE li < $max_age");
|
||||
}
|
||||
}
|
||||
@ -654,7 +653,7 @@
|
||||
}
|
||||
if ($blocked && $GLOBALS['phpgw_info']['server']['admin_mails'] &&
|
||||
// max. one mail each 5mins
|
||||
$GLOBALS['phpgw_info']['server']['login_blocked_mail_time'] < time()-5*60)
|
||||
$GLOBALS['phpgw_info']['server']['login_blocked_mail_time'] < time()-5*60)
|
||||
{
|
||||
// notify admin(s) via email
|
||||
$from = 'eGroupWare@'.$GLOBALS['phpgw_info']['server']['mail_suffix'];
|
||||
@ -707,7 +706,7 @@
|
||||
$phpgw_info_flags = $GLOBALS['phpgw_info']['flags'];
|
||||
|
||||
$GLOBALS['phpgw_info']['flags'] = $phpgw_info_flags;
|
||||
|
||||
|
||||
$this->update_dla();
|
||||
$this->account_id = $GLOBALS['phpgw']->interserver->name2id($this->account_lid);
|
||||
|
||||
@ -717,7 +716,7 @@
|
||||
}
|
||||
|
||||
$GLOBALS['phpgw_info']['user']['account_id'] = $this->account_id;
|
||||
|
||||
|
||||
$this->read_repositories(@$GLOBALS['phpgw_info']['server']['cache_phpgw_info']);
|
||||
|
||||
/* init the crypto object before appsession call below */
|
||||
@ -897,7 +896,7 @@
|
||||
$GLOBALS['phpgw']->accounts->accounts($this->account_id);
|
||||
$GLOBALS['phpgw']->preferences->preferences($this->account_id);
|
||||
$GLOBALS['phpgw']->applications->applications($this->account_id);
|
||||
|
||||
|
||||
if(@$cached)
|
||||
{
|
||||
$this->user = $this->appsession('phpgw_info_cache','phpgwapi');
|
||||
@ -960,17 +959,17 @@
|
||||
$phpgw_info_temp = $GLOBALS['phpgw_info'];
|
||||
$phpgw_info_temp['user']['kp3'] = '';
|
||||
$phpgw_info_temp['flags'] = array();
|
||||
|
||||
|
||||
if ($GLOBALS['phpgw_info']['server']['cache_phpgw_info'])
|
||||
{
|
||||
$this->appsession('phpgw_info_cache','phpgwapi',$phpgw_info_temp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function restore()
|
||||
{
|
||||
$sessionData = $this->appsession('sessiondata');
|
||||
|
||||
|
||||
if (!empty($sessionData) && is_array($sessionData))
|
||||
{
|
||||
foreach($sessionData as $key => $value)
|
||||
@ -1120,7 +1119,7 @@
|
||||
$url = $app.'/'.$url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($full_scriptname)
|
||||
{
|
||||
$webserver_url_count = strlen($GLOBALS['phpgw_info']['server']['webserver_url'])-1;
|
||||
@ -1171,7 +1170,7 @@
|
||||
$extravars['framepart']='body';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* add session params if not using cookies */
|
||||
if (@!$GLOBALS['phpgw_info']['server']['usecookies'])
|
||||
{
|
||||
@ -1179,7 +1178,7 @@
|
||||
$extravars['kp3'] = $this->kp3;
|
||||
$extravars['domain'] = $this->account_domain;
|
||||
}
|
||||
|
||||
|
||||
//used for repost prevention
|
||||
// $extravars['click_history'] = $this->generate_click_history();
|
||||
|
||||
@ -1319,4 +1318,3 @@
|
||||
$GLOBALS['phpgw_info']['server']['sessions_type'] = 'db';
|
||||
}
|
||||
include_once(PHPGW_API_INC.'/class.sessions_'.$GLOBALS['phpgw_info']['server']['sessions_type'].'.inc.php');
|
||||
|
||||
|
@ -92,7 +92,7 @@
|
||||
|
||||
$GLOBALS['phpgw_session']['session_dla'] = time();
|
||||
$GLOBALS['phpgw_session']['session_action'] = $action;
|
||||
|
||||
|
||||
session_register('phpgw_session');
|
||||
$_SESSION['phpgw_session'] = $GLOBALS['phpgw_session'];
|
||||
|
||||
@ -141,7 +141,7 @@
|
||||
$account_id = get_account_id($accountid,$this->account_id);
|
||||
|
||||
$GLOBALS['phpgw_session']['phpgw_app_sessions']['phpgwapi']['phpgw_info_cache'] = '';
|
||||
|
||||
|
||||
session_register('phpgw_session');
|
||||
$_SESSION['phpgw_session'] = $GLOBALS['phpgw_session'];
|
||||
}
|
||||
@ -152,7 +152,7 @@
|
||||
{
|
||||
$appname = $GLOBALS['phpgw_info']['flags']['currentapp'];
|
||||
}
|
||||
|
||||
|
||||
/* This allows the user to put '' as the value. */
|
||||
if ($data == '##NOTHING##')
|
||||
{
|
||||
@ -181,10 +181,12 @@
|
||||
{
|
||||
$sign = strcasecmp($GLOBALS['phpgw']->session->sort_order,'ASC') ? 1 : -1;
|
||||
|
||||
return strcasecmp($a[$GLOBALS['phpgw']->session->sort_by],
|
||||
$b[$GLOBALS['phpgw']->session->sort_by]) * $sign;
|
||||
return strcasecmp(
|
||||
$a[$GLOBALS['phpgw']->session->sort_by],
|
||||
$b[$GLOBALS['phpgw']->session->sort_by]
|
||||
) * $sign;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
@function list_sessions
|
||||
@abstract get list of normal / non-anonymous sessions
|
||||
@ -240,30 +242,30 @@
|
||||
unset($session['phpgw_app_sessions']); // not needed, saves memory
|
||||
$session_cache[$file] = $session;
|
||||
}
|
||||
if ($session['session_flags'] == 'A' || !$session['session_id'] ||
|
||||
$session['session_install_id'] != $GLOBALS['phpgw_info']['server']['install_id'])
|
||||
if($session['session_flags'] == 'A' || !$session['session_id'] ||
|
||||
$session['session_install_id'] != $GLOBALS['phpgw_info']['server']['install_id'])
|
||||
{
|
||||
continue; // no anonymous sessions or other domains or installations
|
||||
}
|
||||
//echo "file='$file'=<pre>"; print_r($session); echo "</pre>";
|
||||
|
||||
|
||||
$session['php_session_file'] = $path . '/' . $file;
|
||||
$values[$session['session_id']] = $session;
|
||||
}
|
||||
closedir($dir);
|
||||
|
||||
if (!$all_no_sort)
|
||||
|
||||
if(!$all_no_sort)
|
||||
{
|
||||
$GLOBALS['phpgw']->session->sort_by = $sort;
|
||||
$GLOBALS['phpgw']->session->sort_order = $order;
|
||||
|
||||
|
||||
uasort($values,array('sessions','session_sort'));
|
||||
|
||||
|
||||
$i = 0;
|
||||
$start = intval($start);
|
||||
$start = (int)$start;
|
||||
foreach($values as $id => $data)
|
||||
{
|
||||
if ($i < $start || $i > $start+$maxmatchs)
|
||||
if($i < $start || $i > $start+$maxmatchs)
|
||||
{
|
||||
unset($values[$id]);
|
||||
}
|
||||
@ -275,7 +277,7 @@
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
@function total
|
||||
@abstract get number of normal / non-anonymous sessions
|
||||
|
Loading…
Reference in New Issue
Block a user