Cleaned up calls to link()

This commit is contained in:
jengo 2001-03-10 08:16:33 +00:00
parent a5a9c54898
commit 9f5b45bf5c
3 changed files with 93 additions and 78 deletions

View File

@ -1,22 +1,24 @@
<?php
/**************************************************************************\
* phpGroupWare - Addressbook *
* http://www.phpgroupware.org *
* Written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/**************************************************************************\
* phpGroupWare - addressbook *
* http://www.phpgroupware.org *
* Written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/* $Id$ */
$phpgw_info["flags"] = array("currentapp" => "addressbook",
"enable_contact_class" => True,
"noheader" => True, "nonavbar" => True);
include("../header.inc.php");
$phpgw_info['flags'] = array(
'currentapp' => 'addressbook',
'enable_contact_class' => True,
'noheader' => True,
'nonavbar' => True
);
include('../header.inc.php');
//if($access == "group")
// $access = $n_groups;
@ -25,6 +27,6 @@
parsevcard($filename,$access);
// Delete the temp file.
unlink($filename);
unlink($filename . ".info");
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/", "cd=14"));
?>
unlink($filename . '.info');
Header('Location: ' . $phpgw->link('/addressbook/index.php','cd=14'));
?>

View File

@ -38,7 +38,7 @@
}
}
}
$phpgw->redirect($phpgw->link($phpgw_info["server"]["webserver_url"] . $phpgw_forward,$extra_vars));
$phpgw->redirect($phpgw->link($phpgw_forward,$extra_vars));
}
if (($phpgw_info["user"]["preferences"]["common"]["useframes"] && $phpgw_info["server"]["useframes"] == "allowed")
@ -54,7 +54,7 @@
));
$tpl->set_var("navbar_link",$phpgw->link("index.php","navbarframe=True&cd=yes"));
if ($forward) {
$tpl->set_var("body_link",$phpgw->link($phpgw_info["server"]["webserver_url"] . $forward));
$tpl->set_var("body_link",$phpgw->link($forward));
} else {
$tpl->set_var("body_link",$phpgw->link("index.php","framebody=True&cd=yes"));
}
@ -77,15 +77,12 @@
}
} elseif ($cd=="yes" && $phpgw_info["user"]["preferences"]["common"]["default_app"]
&& $phpgw_info["user"]["apps"][$phpgw_info["user"]["preferences"]["common"]["default_app"]]) {
$phpgw->redirect($phpgw->link($phpgw_info["server"]["webserver_url"] . "/"
. $phpgw_info["user"]["preferences"]["common"]["default_app"] . "/"
. "index.php"));
$phpgw->redirect($phpgw->link('/' . $phpgw_info["user"]["preferences"]["common"]["default_app"] . "/" . "index.php"));
$phpgw->common->phpgw_exit();
} else {
$phpgw->common->phpgw_header();
echo parse_navbar();
}
//$phpgw->hooks->proccess("location","mainscreen");
@ -156,7 +153,7 @@
include($phpgw_info["server"]["server_root"] . "/stocks/inc/functions.inc.php");
echo '<tr><td align="right">' . return_quotes($quotes) . '</td></tr>';
}
$phpgw->common->hook("",array("email","calendar"));
$phpgw->common->hook('',array('email','calendar','news'));
if ($phpgw_info["user"]["apps"]["addressbook"]
&& $phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) {
echo "<!-- Birthday info -->\n";

View File

@ -1,37 +1,42 @@
<?php
/**************************************************************************\
* phpGroupWare - preferences *
* http://www.phpgroupware.org *
* Written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/**************************************************************************\
* phpGroupWare - preferences *
* http://www.phpgroupware.org *
* Written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
/* $Id$ */
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
$phpgw_info['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'preferences'
);
$phpgw_info["flags"]["currentapp"] = "preferences";
include("../header.inc.php");
include('../header.inc.php');
if (!$phpgw->acl->check("changepassword", 1)){
Header("Location: index.php");
$phpgw->common->phpgw_exit();
}
if (! $phpgw->acl->check('changepassword', 1))
{
Header('Location: ' . $phpgw->link('/preferences/index.php/'));
$phpgw->common->phpgw_exit();
}
if (! $submit) {
$phpgw->common->phpgw_header();
echo parse_navbar();
if (! $submit)
{
$phpgw->common->phpgw_header();
echo parse_navbar();
?>
<form method="POST" action="<?php echo $phpgw->link("changepassword.php"); ?>">
<form method="POST" action="<?php echo $phpgw->link('/preferences/changepassword.php'); ?>">
<table border="0">
<tr>
<td>
<?php echo lang("enter your new password"); ?>
<?php echo lang('enter your new password'); ?>
</td>
<td>
<input type="password" name="n_passwd">
@ -39,7 +44,7 @@
</tr>
<tr>
<td>
<?php echo lang("re-enter your password"); ?>
<?php echo lang('re-enter your password'); ?>
</td>
<td>
<input type="password" name="n_passwd_2">
@ -47,41 +52,52 @@
</tr>
<tr>
<td colspan="2">
<input type="submit" name="submit" value="<?php echo lang("change"); ?>">
<input type="submit" name="submit" value="<?php echo lang('change'); ?>">
</td>
</tr>
</table>
</form>
<br>
<?php
if ($phpgw_info["server"]["auth_type"] != "ldap") {
echo "<pre>" . lang("note: This feature does *not* change your email password. This will "
. "need to be done manually.") . "</pre>";
}
$phpgw->common->phpgw_footer();
if ($phpgw_info['server']['auth_type'] != 'ldap')
{
echo '<pre>' . lang('note: This feature does *not* change your email password. This will '
. 'need to be done manually.') . '</pre>';
}
$phpgw->common->phpgw_footer();
} else {
if ($n_passwd != $n_passwd_2)
$error = lang("the two passwords are not the same");
}
else
{
if ($n_passwd != $n_passwd_2)
{
$error = lang('The two passwords are not the same');
}
if (! $n_passwd)
$error = lang("you must enter a password");
if (! $n_passwd)
{
$error = lang('You must enter a password');
}
if ($error) {
echo parse_navbar();
echo "<p><br>$error</p>";
$phpgw->common->phpgw_exit();
}
if ($error)
{
echo parse_navbar();
echo '<p><br>' . $error . '</p>';
$phpgw->common->phpgw_exit();
}
$o_passwd = $phpgw_info["user"]["passwd"];
$passwd_changed = $phpgw->auth->change_password($o_passwd, $n_passwd);
if (!$passwd_changed){
// This need to be changed to show a different message based on the result
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/","cd=38"));
}else{
$phpgw_info["user"]["passwd"] = $phpgw->auth->change_password($o_passwd, $n_passwd);
$phpgw->accounts->sync();
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/","cd=18"));
}
}
?>
$o_passwd = $phpgw_info['user']['passwd'];
$passwd_changed = $phpgw->auth->change_password($o_passwd, $n_passwd);
if (! $passwd_changed)
{
// This need to be changed to show a different message based on the result
Header('Location: ' . $phpgw->link('/preferences/index.php','cd=38'));
}
else
{
$phpgw_info['user']['passwd'] = $phpgw->auth->change_password($o_passwd, $n_passwd);
$phpgw->accounts->sync();
Header('Location: ' . $phpgw->link('/preferences/index.php','cd=18'));
}
}
?>