diff --git a/preferences/changeprofile.php b/preferences/changeprofile.php index 1549b69416..3bae11b120 100644 --- a/preferences/changeprofile.php +++ b/preferences/changeprofile.php @@ -12,76 +12,86 @@ /* $Id$ */ - Header("Cache-Control: no-cache"); - Header("Pragma: no-cache"); - //Header("Expires: Sat, Jan 01 2000 01:01:01 GMT"); + Header('Cache-Control: no-cache'); + Header('Pragma: no-cache'); + //Header('Expires: Sat, Jan 01 2000 01:01:01 GMT'); - $phpgw_info["flags"]["currentapp"] = "preferences"; - include("../header.inc.php"); - if ($phpgw_info["user"]["permissions"]["anonymous"]) { - Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/")); - $phpgw->common->phpgw_exit(); - } + $phpgw_info = array(); + $GLOBALS['phpgw_info']['flags']['currentapp'] = 'preferences'; + include('../header.inc.php'); - if ($submit) { - if ($picture_size) { - $fh = fopen($picture,"r"); - $picture_raw = fread($fh,$picture_size); - fclose($fh); + if ($GLOBALS['phpgw_info']['user']['permissions']['anonymous']) + { + Header('Location: ' . $GLOBALS['phpgw']->link('/')); + $GLOBALS['phpgw']->common->phpgw_exit(); + } - $phone_number = addslashes($phone_number); - $comments = addslashes($comments); - $title = addslashes($title); + if ($submit) + { + if ($picture_size) + { + $fh = fopen($picture,'rb'); + $picture_raw = fread($fh,$picture_size); + fclose($fh); - if ($phpgw_info["server"]["db_type"] == "mysql") { - $picture_raw = addslashes($picture_raw); - } else { - $picture_raw = base64_encode($picture_raw); - } + $phone_number = addslashes($phone_number); + $comments = addslashes($comments); + $title = addslashes($title); - $phpgw->db->query("delete from profiles where owner='" . $phpgw_info["user"]["userid"] . "'"); + if ($GLOBALS['phpgw_info']['server']['db_type'] == 'mysql') + { + $picture_raw = addslashes($picture_raw); + } + else + { + $picture_raw = base64_encode($picture_raw); + } - $phpgw->db->query("insert into profiles (owner,title,phone_number,comments," - . "picture_format,picture) values ('" . $phpgw_info["user"]["userid"] . "','" - . "$title','$phone_number','$comments','$picture_type','$picture_raw')"); - } else { - $phone_number = addslashes($phone_number); - $picture_raw = addslashes($picture_raw); - $comments = addslashes($comments); - $title = addslashes($title); + $GLOBALS['phpgw']->db->query("delete from profiles where owner='" . $GLOBALS['phpgw_info']['user']['userid'] . "'"); - $phpgw->db->query("update profiles set title='$title',phone_number='$phone_number'," - . "comments='$comments' where owner='" . $phpgw_info["user"]["userid"] . "'"); - } - echo "
Your profile has been updated
"; - } + $GLOBALS['phpgw']->db->query("insert into profiles (owner,title,phone_number,comments," + . "picture_format,picture) values ('" . $GLOBALS['phpgw_info']['user']['userid'] . "','" + . "$title','$phone_number','$comments','$picture_type','$picture_raw')"); + } + else + { + $phone_number = addslashes($phone_number); + $picture_raw = addslashes($picture_raw); + $comments = addslashes($comments); + $title = addslashes($title); - $phpgw->db->query("select * from profiles where owner='" . $phpgw_info["user"]["userid"] . "'"); - $phpgw->db->next_record(); + $GLOBALS['phpgw']->db->query("update profiles set title='$title',phone_number='$phone_number'," + . "comments='$comments' where owner='" . $GLOBALS['phpgw_info']['user']['userid'] . "'"); + } + echo '
Your profile has been updated
'; + } + + $GLOBALS['phpgw']->db->query("select * from profiles where owner='" . $GLOBALS['phpgw_info']['user']['userid'] . "'"); + $GLOBALS['phpgw']->db->next_record(); ?> -
"> + - + - + - + - + @@ -95,4 +105,6 @@
common->display_fullname($phpgw_info["user"]["userid"],$phpgw_info["user"]["firstname"],$phpgw_info["user"]["lastname"]); ?>common->display_fullname($GLOBALS['phpgw_info']['user']['userid'],$GLOBALS['phpgw_info']['user']['firstname'],$GLOBALS['phpgw_info']['user']['lastname']); ?>  
Title:"> - width="100" height="120"> +
Phone number:">
Comments:
-common->phpgw_footer(); ?> +common->phpgw_footer(); +?>