Update of /cvsroot/phpicalendar/phpicalendar/functions
In directory sc8-pr-cvs1:/tmp/cvs-serv7008/functions
Modified Files:
init.inc.php
Log Message:
Made some changed to user:pass system to be more auto configuring, and
now cookies work as well, as well as fixing subscribe and download links.
Index: init.inc.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/functions/init.inc.php,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** init.inc.php 22 Nov 2003 21:16:10 -0000 1.45
--- init.inc.php 24 Nov 2003 01:29:17 -0000 1.46
***************
*** 24,27 ****
--- 24,31 ----
}
+ if ($cookie_uri == '') {
+ $cookie_uri = $HTTP_SERVER_VARS['SERVER_NAME'].substr($HTTP_SERVER_VARS['PHP_SELF'],0,strpos($HTTP_SERVER_VARS['PHP_SELF'], '/'));
+ }
+
// Look for a login cookie.
unset($username, $password);
***************
*** 39,47 ****
// Set the login cookie if logging in. Clear it if logging out.
! if (isset($HTTP_GET_VARS['action'])) {
! $action = $HTTP_GET_VARS['action'];
! } else {
! $action = '';
! }
if ($action == 'login') {
$the_cookie = serialize(array('username' => $username, 'password' => $password));
--- 43,48 ----
// Set the login cookie if logging in. Clear it if logging out.
! $action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
!
if ($action == 'login') {
$the_cookie = serialize(array('username' => $username, 'password' => $password));
***************
*** 134,141 ****
// Sets the download and subscribe paths from the config if present.
! if ($download_uri == '' && preg_match('/(^\/|..\/)/', $filename) == 0) {
$subscribe_path = 'webcal://'.$HTTP_SERVER_VARS['SERVER_NAME'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/'.$filename;
$download_filename = $filename;
! } else if ($download_uri != '') {
$newurl = eregi_replace("^(http://)", "", $download_uri);
$subscribe_path = 'webcal://'.$newurl.'/'.$cal_filename.'.ics';
--- 135,142 ----
// Sets the download and subscribe paths from the config if present.
! if ($download_uri == '') {
$subscribe_path = 'webcal://'.$HTTP_SERVER_VARS['SERVER_NAME'].dirname($HTTP_SERVER_VARS['PHP_SELF']).'/'.$filename;
$download_filename = $filename;
! } elseif ($download_uri != '') {
$newurl = eregi_replace("^(http://)", "", $download_uri);
$subscribe_path = 'webcal://'.$newurl.'/'.$cal_filename.'.ics';
|