C:\$Recycle.Bin\S-1-5-21-3967099092-2644009230-141905953-500\$RE86HC9\ws\login.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/*
 * $Id: login.php,v 1.2 2004/08/03 01:14:22 cknudsen Exp $
 *
 * Description:
 *     Provides login mechanism for web service clients.
 */

$basedir "..";
$includedir "../includes";

include 
"$includedir/config.php";
include 
"$includedir/php-dbi.php";
include 
"$includedir/functions.php";
include 
"$includedir/$user_inc";
include 
"$includedir/connect.php";

load_global_settings ();

if ( ! empty ( 
$last_login ) )
  
$login "";

include 
"$includedir/translate.php";

// calculate path for cookie
if ( empty ( $PHP_SELF ) )
  
$PHP_SELF $_SERVER["PHP_SELF"];
$cookie_path str_replace "login.php"""$PHP_SELF );
//echo "Cookie path: $cookie_path\n";

$out "<login>\n";

if ( 
$single_user == "Y" ) {
  
// No login for single-user mode
  
$out .= "<error>No login required for single-user mode</error>\n";
} else if ( 
$use_http_auth ) {
  
// There is no login page when using HTTP authorization
  
$out .= "<error>No login required for HTTP authentication</error>\n";
} else {
  if ( ! empty ( 
$login ) && ! empty ( $password ) ) {
    
$login trim $login );
    if ( 
user_valid_login $login$password ) ) {
      
user_load_variables $login"" );
      
// set login to expire in 365 days
      
srand((double) microtime() * 1000000);
      
$salt chrrand(ord('A'), ord('z'))) . chrrand(ord('A'), ord('z')));
      
$encoded_login encode_string $login "|" crypt($password$salt) );
      
//SetCookie ( "webcalendar_session", $encoded_login, 0, $cookie_path );
      
$out .= "  <cookieName>webcalendar_session</cookieName>\n";
      
$out .= "  <cookieValue>$encoded_login</cookieValue>\n";
      if ( 
$is_admin )
        
$out .= "  <admin>1</admin>\n";
    } else {
      
$out .= "  <error>Invalid login</error>\n";
    }
  }
}

echo 
$out;
echo 
"</login>\n";
?>