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 <?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. *
\**************************************************************************/
/**************************************************************************\ /* $Id$ */
* 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$ */ $phpgw_info['flags'] = array(
'currentapp' => 'addressbook',
$phpgw_info["flags"] = array("currentapp" => "addressbook", 'enable_contact_class' => True,
"enable_contact_class" => True, 'noheader' => True,
"noheader" => True, "nonavbar" => True); 'nonavbar' => True
include("../header.inc.php"); );
include('../header.inc.php');
//if($access == "group") //if($access == "group")
// $access = $n_groups; // $access = $n_groups;
@ -25,6 +27,6 @@
parsevcard($filename,$access); parsevcard($filename,$access);
// Delete the temp file. // Delete the temp file.
unlink($filename); unlink($filename);
unlink($filename . ".info"); unlink($filename . '.info');
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/", "cd=14")); 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") 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")); $tpl->set_var("navbar_link",$phpgw->link("index.php","navbarframe=True&cd=yes"));
if ($forward) { if ($forward) {
$tpl->set_var("body_link",$phpgw->link($phpgw_info["server"]["webserver_url"] . $forward)); $tpl->set_var("body_link",$phpgw->link($forward));
} else { } else {
$tpl->set_var("body_link",$phpgw->link("index.php","framebody=True&cd=yes")); $tpl->set_var("body_link",$phpgw->link("index.php","framebody=True&cd=yes"));
} }
@ -77,9 +77,7 @@
} }
} elseif ($cd=="yes" && $phpgw_info["user"]["preferences"]["common"]["default_app"] } elseif ($cd=="yes" && $phpgw_info["user"]["preferences"]["common"]["default_app"]
&& $phpgw_info["user"]["apps"][$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->redirect($phpgw->link('/' . $phpgw_info["user"]["preferences"]["common"]["default_app"] . "/" . "index.php"));
. $phpgw_info["user"]["preferences"]["common"]["default_app"] . "/"
. "index.php"));
$phpgw->common->phpgw_exit(); $phpgw->common->phpgw_exit();
} else { } else {
$phpgw->common->phpgw_header(); $phpgw->common->phpgw_header();
@ -87,7 +85,6 @@
} }
//$phpgw->hooks->proccess("location","mainscreen"); //$phpgw->hooks->proccess("location","mainscreen");
// $phpgw->preferences->read_preferences("addressbook"); // $phpgw->preferences->read_preferences("addressbook");
@ -156,7 +153,7 @@
include($phpgw_info["server"]["server_root"] . "/stocks/inc/functions.inc.php"); include($phpgw_info["server"]["server_root"] . "/stocks/inc/functions.inc.php");
echo '<tr><td align="right">' . return_quotes($quotes) . '</td></tr>'; 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"] if ($phpgw_info["user"]["apps"]["addressbook"]
&& $phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) { && $phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) {
echo "<!-- Birthday info -->\n"; echo "<!-- Birthday info -->\n";

View File

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