[ros-diffs] [cfinck] 36535: Commit missing stuff from the server (1/2) This is not yet meant to work, I'm just committing unmodified files from the Web server for making it easier to track my changes later.
cfinck at svn.reactos.org
cfinck at svn.reactos.org
Fri Sep 26 13:54:50 CEST 2008
Author: cfinck
Date: Fri Sep 26 06:54:49 2008
New Revision: 36535
URL: http://svn.reactos.org/svn/reactos?rev=36535&view=rev
Log:
Commit missing stuff from the server (1/2)
This is not yet meant to work, I'm just committing unmodified files from the Web server for making it easier to track my changes later.
Added:
trunk/web/reactos.org/htdocs/roscms/inc/footer_closetable.php (with props)
trunk/web/reactos.org/htdocs/roscms/logon/language_detection.php (with props)
trunk/web/reactos.org/htdocs/roscms/logon/login.php
trunk/web/reactos.org/htdocs/roscms/logon/login_optional.php (with props)
trunk/web/reactos.org/htdocs/roscms/logon/logon.css (with props)
trunk/web/reactos.org/htdocs/roscms/logon/logout.php
trunk/web/reactos.org/htdocs/roscms/logon/subsys_login.php (with props)
Removed:
trunk/web/reactos.org/htdocs/roscms/images/Thumbs.db
trunk/web/reactos.org/htdocs/roscms/inc/connect.db.php
Modified:
trunk/web/reactos.org/htdocs/roscms/inc/data.php
trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php
trunk/web/reactos.org/htdocs/roscms/inc/header.php
trunk/web/reactos.org/htdocs/roscms/inc/securitylog.php
trunk/web/reactos.org/htdocs/roscms/inc/structure.php
trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php
trunk/web/reactos.org/htdocs/roscms/inc/tools.php
Removed: trunk/web/reactos.org/htdocs/roscms/images/Thumbs.db
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/images/Thumbs.db?rev=36534&view=auto
==============================================================================
Binary file - no diff available.
Removed: trunk/web/reactos.org/htdocs/roscms/inc/connect.db.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/connect.db.php?rev=36534&view=auto
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/connect.db.php [iso-8859-1] (original)
+++ trunk/web/reactos.org/htdocs/roscms/inc/connect.db.php (removed)
@@ -1,40 +1,0 @@
-<?php
- /*
- RosCMS - ReactOS Content Management System
- Copyright (C) 2005 Klemens Friedl <frik85 at reactos.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.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-
-
-// Database:
-$dbHost = "localhost";
-$dbUser = "root";
-$dbPass = "";
-$dbName = "roscms";
-
-
-$connect = @mysql_connect($dbHost, $dbUser, $dbPass) or die("ERROR: Cannot connect to the database!");
-$selectDB = @mysql_select_db($dbName, $connect) or die("Cannot find and select <b>$dbName</b>!");
-
-// Delete (set nothing) the vars after usage:
-$dbHost = "";
-$dbUser = "";
-$dbPass = "";
-$dbName = "";
-
-
-?>
Modified: trunk/web/reactos.org/htdocs/roscms/inc/data.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/data.php?rev=36535&r1=36534&r2=36535&view=diff
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/data.php [iso-8859-1] (original)
+++ trunk/web/reactos.org/htdocs/roscms/inc/data.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -81,6 +81,11 @@
echo "<br />";
echo "<p>Currently not implemented!</p>";
break;
+ case "stats":
+ require("inc/data_menu.php");
+ echo "<br />";
+ require("../stats/admin/view_stats.php");
+ break;
}
}
Modified: trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php?rev=36535&r1=36534&r2=36535&view=diff
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php [iso-8859-1] (original)
+++ trunk/web/reactos.org/htdocs/roscms/inc/data_menu.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -140,6 +140,9 @@
case "maintain";
$curmenu = "maintain";
break;
+ case "stats";
+ $curmenu = "stats";
+ break;
}
break;
/*case "user";
@@ -176,6 +179,9 @@
break;
case 'maintain':
temp_page2 = 'data&branch=maintain';
+ break;
+ case 'stats':
+ temp_page2 = 'data&branch=stats';
break;
}
@@ -243,6 +249,13 @@
</div>
<div class="tblbl">Maintain</div></th>
<td> </td>
+ <th class="int<?php if ($curmenu == "stats") { echo "2"; } else { echo "1"; } ?>" onclick="roscms_mainmenu('stats')"> <div class="tc1">
+ <div class="tc2">
+ <div class="tc3"></div>
+ </div>
+ </div>
+ <div class="tblbl">Statistics</div></th>
+ <td> </td>
<?php } ?>
<td width="100%"><div align="right" id="ajaxloadinginfo" style="visibility:hidden;"><img src="images/ajax_loading.gif" alt="loading ..." width="13" height="13" /></div></td>
@@ -268,6 +281,9 @@
else if ($curmenu == "maintain") {
echo 'RosCMS Maintainer Interface';
}
+ else if ($curmenu == "stats") {
+ echo 'RosCMS Website Statistics';
+ }
?>
</div>
</div>
Added: trunk/web/reactos.org/htdocs/roscms/inc/footer_closetable.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/footer_closetable.php?rev=36535&view=auto
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/footer_closetable.php (added)
+++ trunk/web/reactos.org/htdocs/roscms/inc/footer_closetable.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,0 +1,1 @@
+</td></tr></table>
Propchange: trunk/web/reactos.org/htdocs/roscms/inc/footer_closetable.php
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/web/reactos.org/htdocs/roscms/inc/header.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/header.php?rev=36535&r1=36534&r2=36535&view=diff
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/header.php [iso-8859-1] (original)
+++ trunk/web/reactos.org/htdocs/roscms/inc/header.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -44,7 +44,7 @@
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
-<html lang="<?php echo $roscms_langres['lang_code']; ?>">
+<html lang="de">
<head>
<title>ReactOS <?php if ($page_title != "") { echo "- ".$page_title; } ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $roscms_langres['charset']; ?>" />
Modified: trunk/web/reactos.org/htdocs/roscms/inc/securitylog.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/securitylog.php?rev=36535&r1=36534&r2=36535&view=diff
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/securitylog.php [iso-8859-1] (original)
+++ trunk/web/reactos.org/htdocs/roscms/inc/securitylog.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,67 +1,0 @@
-<?php
- /*
- RosCMS - ReactOS Content Management System
- Copyright (C) 2005 Klemens Friedl <frik85 at reactos.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.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- if ( !defined('ROSCMS_SYSTEM_LOG') ) {
- die("Hacking attempt");
- }
-
- @include("db/connect_db.inc.php"); // database connection script
-
- if(session_is_registered('varusr') || $_SESSION['varusr'] != "") {
- $roscms_intern_login_check_username=$_SESSION['varusr'];
- $roscms_intern_login_check_password=$_SESSION['varpass'];
- }
- else {
- $roscms_intern_login_check_username = $HTTP_COOKIE_VARS["rosname"];
- $roscms_intern_login_check_password = $HTTP_COOKIE_VARS["rospass"];
- }
-
- @$accountlogin_query = @mysql_query("SELECT usr_name, usr_roscms_passwd, usr_usergroup, usr_name_id FROM user WHERE usr_name = '".$roscms_intern_login_check_username."'") or die('DB error (login)!');
- @$accountlogin_result = @mysql_fetch_array($accountlogin_query);
-
-
- $usrgrp=$accountlogin_result['usr_usergroup'];
-
- // Usergroup:
- @$accountloginlevel_query = @mysql_query("SELECT *
- FROM `usergroups`
- WHERE 1 AND `usrgroup_name_id` = '$usrgrp'") or die('DB error (login)!');
- @$accountloginlevel_result = @mysql_fetch_array($accountloginlevel_query);
-
-
- // Vars for other php scripts: (only use this vars for login/account check!)
-
- // Usergroup:
- $roscms_intern_account_level=$accountloginlevel_result['usrgroup_securitylevel'];
- $roscms_intern_account_group=$accountloginlevel_result['usrgroup_name'];
-
- // User:
- $roscms_intern_account_id=$accountlogin_result['usr_name_id'];
-
-
- $roscms_intern_log_text = "<b>Collected Information:</b><br>\n GATEWAY_INTERFACE: $GATEWAY_INTERFACE <br>\n SERVER_NAME: $SERVER_NAME <br>\n SERVER_SOFTWARE: $SERVER_SOFTWARE <br>\n SERVER_PROTOCOL: $SERVER_PROTOCOL <br>\n REQUEST_METHOD: $REQUEST_METHOD <br>\n QUERY_STRING: $QUERY_STRING <br>\n DOCUMENT_ROOT: $DOCUMENT_ROOT <br>\n HTTP_ACCEPT: $HTTP_ACCEPT <br>\n HTTP_ACCEPT_CHARSET: $HTTP_ACCEPT_CHARSET <br>\n HTTP_ENCODING: $HTTP_ENCODING <br>\n HTTP_ACCEPT_LANGUAGE: $HTTP_ACCEPT_LANGUAGE<br>\n HTTP_CONNECTION: $HTTP_CONNECTION <br>\n HTTP_HOST: $HTTP_HOST <br>\n HTTP_REFERER: $HTTP_REFERER <br>\n HTTP_USER_AGENT: $HTTP_USER_AGENT <br>\n REMOTE_ADDR: $REMOTE_ADDR <br>\n REMOTE_PORT: $REMOTE_PORT <br>\n SCRIPT_FILENAME: $SCRIPT_FILENAME <br>\n SERVER_ADMIN: $SERVER_ADMIN <br>\n SERVER_PORT: $SERVER_PORT <br>\n SERVER_SIGNATURE: $SERVER_SIGNATURE <br>\n PATH_TRANSLATED: $PATH_TRANSLATED <br>\n SCRIPT_NAME: $SCRIPT_NAME <br>\n REQUEST_URI: $REQUEST_URI <br>\n";
-
- @$accountloginlevel_query = @mysql_query("INSERT INTO `roscms_security_log` ( `roscms_sec_log_id` , `roscms_sec_log_section` , `roscms_sec_log_priority` , `roscms_sec_log_reason` , `roscms_sec_log_user` , `roscms_sec_log_useraccount` , `roscms_sec_log_userip` , `roscms_sec_log_referrer` , `roscms_sec_log_text` , `roscms_sec_log_date` , `roscms_sec_log_time` , `roscms_sec_log_visible` )
- VALUES ('', '$seclog_section', '$seclog_level', '$seclog_reason', 'roscms_system', '$roscms_intern_account_id', '$REMOTE_ADDR', '$HTTP_REFERER', '$roscms_intern_log_text', CURDATE( ) , CURTIME( ) , '1');") or die('DB error (login)!');
- @$accountloginlevel_result = @mysql_fetch_array($accountloginlevel_query);
-
-
-
-?>
Modified: trunk/web/reactos.org/htdocs/roscms/inc/structure.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/structure.php?rev=36535&r1=36534&r2=36535&view=diff
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/structure.php [iso-8859-1] (original)
+++ trunk/web/reactos.org/htdocs/roscms/inc/structure.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -127,10 +127,9 @@
?>
</optgroup>
<optgroup label="most popular">
- <option value="bg">ÐÑлгаÑÑки (Bulgarian)</option>
<option value="en">English</option>
+ <option value="de">Deutsch (German)</option>
<option value="fr">Français (French)</option>
- <option value="de">Deutsch (German)</option>
<option value="it">Italiano (Italian)</option>
<option value="no">Norsk (Norwegian)</option>
<option value="pl">Polski (Polish)</option>
Modified: trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php?rev=36535&r1=36534&r2=36535&view=diff
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php [iso-8859-1] (original)
+++ trunk/web/reactos.org/htdocs/roscms/inc/subsys_login.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,147 +1,5 @@
<?php
- /*
- RosCMS - ReactOS Content Management System
- Copyright (C) 2005 Ge van Geldorp <gvg at reactos.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.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-require_once("utils.php");
-
-define('ROSCMS_LOGIN_OPTIONAL', 1);
-define('ROSCMS_LOGIN_REQUIRED', 2);
-
-function roscms_subsys_login($subsys, $login_type, $target)
-{
- if (ROSCMS_LOGIN_OPTIONAL != $login_type &&
- ROSCMS_LOGIN_REQUIRED != $login_type)
- {
- die("Invalid login_type $login_type for roscms_subsys_login");
- }
-
- if (isset($_COOKIE['roscmsusrkey']) &&
- preg_match('/^([a-z]{32})$/', $_COOKIE['roscmsusrkey'], $matches))
- {
- $session_id_clean = $matches[1];
-
- if (isset($_SERVER['REMOTE_ADDR']) &&
- preg_match('/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/',
- $_SERVER['REMOTE_ADDR'], $matches) )
- {
- $remote_addr_clean = $matches[1];
- }
- else
- {
- $remote_addr_clean = 'invalid';
- }
- if (isset($_SERVER['HTTP_USER_AGENT']))
- {
- $browser_agent_clean = $_SERVER['HTTP_USER_AGENT'];
- }
- else
- {
- $browser_agent_clean = 'unknown';
- }
-
- require("connect.db.php");
-
- /* Clean out expired sessions */
- $query = "DELETE FROM user_sessions " .
- " WHERE usersession_expires IS NOT NULL " .
- " AND usersession_expires < NOW()";
- mysql_query($query, $connect);
-
- /* Now, see if we have a valid login session */
- $bulk_of_where = " WHERE s.usersession_id = '" .
- mysql_escape_string($session_id_clean) . "' " .
- " AND u.user_id = s.usersession_user_id " .
- " AND (u.user_setting_ipaddress = 'false' OR " .
- " s.usersession_ipaddress = '" .
- mysql_escape_string($remote_addr_clean) . "') " .
- " AND (u.user_setting_browseragent = 'false' OR " .
- " s.usersession_browseragent = '" .
- mysql_escape_string($browser_agent_clean) . "') ";
- if ($subsys == "roscms" || $subsys == "")
- {
- $query = "SELECT u.user_id, s.usersession_expires " .
- " FROM roscms.user_sessions s, " .
- " roscms.users u " .
- $bulk_of_where;
- }
- else
- {
- $query = "SELECT m.map_subsys_userid, s.usersession_expires " .
- " FROM roscms.user_sessions s, " .
- " roscms.users u, " .
- " roscms.subsys_mappings m " .
- $bulk_of_where .
- " AND m.map_roscms_userid = s.usersession_user_id " .
- " AND m.map_subsys_name = '" .
- mysql_escape_string($subsys) . "'";
- }
- $statement = mysql_query($query, $connect)
- or die('DB error (user login) ' . $query);
-
- if ($row = mysql_fetch_array($statement))
- {
- /* Login session found */
- $userid = $row[0];
-
- // For the Wiki, we have to start a session
- if( $subsys == "wiki" )
- {
- define('MEDIAWIKI', '');
- require_once("../wiki/includes/GlobalFunctions.php");
- wfSetupSession();
- }
-
- if (isset($row[1]))
- {
- /* Session with timeout. Update the expiry time in the table and
- the expiry time of the cookie */
- $query = "UPDATE roscms.user_sessions " .
- " SET usersession_expires = DATE_ADD(NOW(), INTERVAL 30 MINUTE) " .
- " WHERE usersession_id = '" .
- mysql_escape_string($session_id_clean) . "'";
- mysql_query($query, $connect);
- setcookie('roscmsusrkey', $session_id_clean,
- time() + 60 * 60, '/', cookie_domain());
- }
- }
- else
- {
- $userid = 0;
- }
- }
- else
- {
- $userid = 0;
- }
-
- if (0 == $userid && ROSCMS_LOGIN_REQUIRED == $login_type)
- {
- $url = "/roscms/?page=login";
- if ("" != $target)
- {
- $url .= "&target=" . urlencode($target);
- }
- header("Location: $url");
- exit;
- }
-
- return $userid;
-}
+ require_once("/web/reactos.org/htdocs/roscms/logon/subsys_login.php");
?>
Modified: trunk/web/reactos.org/htdocs/roscms/inc/tools.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/inc/tools.php?rev=36535&r1=36534&r2=36535&view=diff
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/inc/tools.php [iso-8859-1] (original)
+++ trunk/web/reactos.org/htdocs/roscms/inc/tools.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -33,8 +33,6 @@
$intSecondMonth = $arrSecondDate[1];
$intSecondDay = $arrSecondDate[2];
- //echo "<p>ooo: ".$intFirstMonth.", ".$intFirstDay.", ".$intFirstYear."</p>";
-
// Calculate the diference of the two dates and return the number of days
$intDate1Jul = gregoriantojd($intFirstMonth, $intFirstDay, $intFirstYear);
Added: trunk/web/reactos.org/htdocs/roscms/logon/language_detection.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/logon/language_detection.php?rev=36535&view=auto
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/logon/language_detection.php (added)
+++ trunk/web/reactos.org/htdocs/roscms/logon/language_detection.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,0 +1,229 @@
+<?php
+/*
+ Script Name: Full Operating system language detection
+ Author: Harald Hope, Website: http://techpatterns.com/
+ Script Source URI: http://techpatterns.com/downloads/php_language_detection.php
+ Version 0.3.4
+ Copyright (C) 29 November 2007
+ GNU GPL
+*/
+
+//$tmp = get_languages();
+//echo "<p>LANG: ".$tmp[0][0]."</p>";
+
+
+// choice of redirection header or just getting language data
+// to call this you only need to use the $feature parameter
+function get_languages()
+{
+ // get the languages
+ $a_languages = languages();
+ $index = '';
+ $complete = '';
+ $found = false;// set to default value
+ //prepare user language array
+ $user_languages = array();
+
+ //check to see if language is set
+ if ( isset( $_SERVER["HTTP_ACCEPT_LANGUAGE"] ) )
+ {
+ //explode languages into array
+ $languages = strtolower( $_SERVER["HTTP_ACCEPT_LANGUAGE"] );
+ $languages = explode( ",", $languages );
+
+ foreach ( $languages as $language_list )
+ {
+ // pull out the language, place languages into array of full and primary
+ // string structure:
+ $temp_array = array();
+ // slice out the part before ; on first step, the part before - on second, place into array
+ $temp_array[0] = substr( $language_list, 0, strcspn( $language_list, ';' ) );//full language
+ $temp_array[1] = substr( $language_list, 0, 2 );// cut out primary language
+ //place this array into main $user_languages language array
+ $user_languages[] = $temp_array;
+ }
+
+ //start going through each one
+ for ( $i = 0; $i < count( $user_languages ); $i++ )
+ {
+ foreach ( $a_languages as $index => $complete )
+ {
+ if ( $index == $user_languages[$i][0] )
+ {
+ // complete language, like english (canada)
+ $user_languages[$i][2] = $complete;
+ // extract working language, like english
+ $user_languages[$i][3] = substr( $complete, 0, strcspn( $complete, ' (' ) );
+ }
+ }
+ }
+ }
+ else // if no languages found
+ {
+ $user_languages[0] = array( '','','','' ); //return blank array.
+ }
+
+ return $user_languages;
+}
+
+function languages()
+{
+// pack abbreviation/language array
+// important note: you must have the default language as the last item in each major language, after all the
+// en-ca type entries, so en would be last in that case
+ $a_languages = array(
+ 'af' => 'Afrikaans',
+ 'sq' => 'Albanian',
+ 'ar-dz' => 'Arabic (Algeria)',
+ 'ar-bh' => 'Arabic (Bahrain)',
+ 'ar-eg' => 'Arabic (Egypt)',
+ 'ar-iq' => 'Arabic (Iraq)',
+ 'ar-jo' => 'Arabic (Jordan)',
+ 'ar-kw' => 'Arabic (Kuwait)',
+ 'ar-lb' => 'Arabic (Lebanon)',
+ 'ar-ly' => 'Arabic (libya)',
+ 'ar-ma' => 'Arabic (Morocco)',
+ 'ar-om' => 'Arabic (Oman)',
+ 'ar-qa' => 'Arabic (Qatar)',
+ 'ar-sa' => 'Arabic (Saudi Arabia)',
+ 'ar-sy' => 'Arabic (Syria)',
+ 'ar-tn' => 'Arabic (Tunisia)',
+ 'ar-ae' => 'Arabic (U.A.E.)',
+ 'ar-ye' => 'Arabic (Yemen)',
+ 'ar' => 'Arabic',
+ 'hy' => 'Armenian',
+ 'as' => 'Assamese',
+ 'az' => 'Azeri',
+ 'eu' => 'Basque',
+ 'be' => 'Belarusian',
+ 'bn' => 'Bengali',
+ 'bg' => 'Bulgarian',
+ 'ca' => 'Catalan',
+ 'zh-cn' => 'Chinese (China)',
+ 'zh-hk' => 'Chinese (Hong Kong SAR)',
+ 'zh-mo' => 'Chinese (Macau SAR)',
+ 'zh-sg' => 'Chinese (Singapore)',
+ 'zh-tw' => 'Chinese (Taiwan)',
+ 'zh' => 'Chinese',
+ 'hr' => 'Croatian',
+ 'cs' => 'Czech',
+ 'da' => 'Danish',
+ 'div' => 'Divehi',
+ 'nl-be' => 'Dutch (Belgium)',
+ 'nl' => 'Dutch (Netherlands)',
+ 'en-au' => 'English (Australia)',
+ 'en-bz' => 'English (Belize)',
+ 'en-ca' => 'English (Canada)',
+ 'en-ie' => 'English (Ireland)',
+ 'en-jm' => 'English (Jamaica)',
+ 'en-nz' => 'English (New Zealand)',
+ 'en-ph' => 'English (Philippines)',
+ 'en-za' => 'English (South Africa)',
+ 'en-tt' => 'English (Trinidad)',
+ 'en-gb' => 'English (United Kingdom)',
+ 'en-us' => 'English (United States)',
+ 'en-zw' => 'English (Zimbabwe)',
+ 'en' => 'English',
+ 'us' => 'English (United States)',
+ 'et' => 'Estonian',
+ 'fo' => 'Faeroese',
+ 'fa' => 'Farsi',
+ 'fi' => 'Finnish',
+ 'fr-be' => 'French (Belgium)',
+ 'fr-ca' => 'French (Canada)',
+ 'fr-lu' => 'French (Luxembourg)',
+ 'fr-mc' => 'French (Monaco)',
+ 'fr-ch' => 'French (Switzerland)',
+ 'fr' => 'French (France)',
+ 'mk' => 'FYRO Macedonian',
+ 'gd' => 'Gaelic',
+ 'ka' => 'Georgian',
+ 'de-at' => 'German (Austria)',
+ 'de-li' => 'German (Liechtenstein)',
+ 'de-lu' => 'German (Luxembourg)',
+ 'de-ch' => 'German (Switzerland)',
+ 'de' => 'German (Germany)',
+ 'el' => 'Greek',
+ 'gu' => 'Gujarati',
+ 'he' => 'Hebrew',
+ 'hi' => 'Hindi',
+ 'hu' => 'Hungarian',
+ 'is' => 'Icelandic',
+ 'id' => 'Indonesian',
+ 'it-ch' => 'Italian (Switzerland)',
+ 'it' => 'Italian (Italy)',
+ 'ja' => 'Japanese',
+ 'kn' => 'Kannada',
+ 'kk' => 'Kazakh',
+ 'kok' => 'Konkani',
+ 'ko' => 'Korean',
+ 'kz' => 'Kyrgyz',
+ 'lv' => 'Latvian',
+ 'lt' => 'Lithuanian',
+ 'ms' => 'Malay',
+ 'ml' => 'Malayalam',
+ 'mt' => 'Maltese',
+ 'mr' => 'Marathi',
+ 'mn' => 'Mongolian (Cyrillic)',
+ 'ne' => 'Nepali (India)',
+ 'nb-no' => 'Norwegian (Bokmal)',
+ 'nn-no' => 'Norwegian (Nynorsk)',
+ 'no' => 'Norwegian (Bokmal)',
+ 'or' => 'Oriya',
+ 'pl' => 'Polish',
+ 'pt-br' => 'Portuguese (Brazil)',
+ 'pt' => 'Portuguese (Portugal)',
+ 'pa' => 'Punjabi',
+ 'rm' => 'Rhaeto-Romanic',
+ 'ro-md' => 'Romanian (Moldova)',
+ 'ro' => 'Romanian',
+ 'ru-md' => 'Russian (Moldova)',
+ 'ru' => 'Russian',
+ 'sa' => 'Sanskrit',
+ 'sr' => 'Serbian',
+ 'sk' => 'Slovak',
+ 'ls' => 'Slovenian',
+ 'sb' => 'Sorbian',
+ 'es-ar' => 'Spanish (Argentina)',
+ 'es-bo' => 'Spanish (Bolivia)',
+ 'es-cl' => 'Spanish (Chile)',
+ 'es-co' => 'Spanish (Colombia)',
+ 'es-cr' => 'Spanish (Costa Rica)',
+ 'es-do' => 'Spanish (Dominican Republic)',
+ 'es-ec' => 'Spanish (Ecuador)',
+ 'es-sv' => 'Spanish (El Salvador)',
+ 'es-gt' => 'Spanish (Guatemala)',
+ 'es-hn' => 'Spanish (Honduras)',
+ 'es-mx' => 'Spanish (Mexico)',
+ 'es-ni' => 'Spanish (Nicaragua)',
+ 'es-pa' => 'Spanish (Panama)',
+ 'es-py' => 'Spanish (Paraguay)',
+ 'es-pe' => 'Spanish (Peru)',
+ 'es-pr' => 'Spanish (Puerto Rico)',
+ 'es-us' => 'Spanish (United States)',
+ 'es-uy' => 'Spanish (Uruguay)',
+ 'es-ve' => 'Spanish (Venezuela)',
+ 'es' => 'Spanish (Traditional Sort)',
+ 'sx' => 'Sutu',
+ 'sw' => 'Swahili',
+ 'sv-fi' => 'Swedish (Finland)',
+ 'sv' => 'Swedish',
+ 'syr' => 'Syriac',
+ 'ta' => 'Tamil',
+ 'tt' => 'Tatar',
+ 'te' => 'Telugu',
+ 'th' => 'Thai',
+ 'ts' => 'Tsonga',
+ 'tn' => 'Tswana',
+ 'tr' => 'Turkish',
+ 'uk' => 'Ukrainian',
+ 'ur' => 'Urdu',
+ 'uz' => 'Uzbek',
+ 'vi' => 'Vietnamese',
+ 'xh' => 'Xhosa',
+ 'yi' => 'Yiddish',
+ 'zu' => 'Zulu' );
+
+ return $a_languages;
+}
+?>
Propchange: trunk/web/reactos.org/htdocs/roscms/logon/language_detection.php
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/web/reactos.org/htdocs/roscms/logon/login.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/logon/login.php?rev=36535&view=auto
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/logon/login.php (added)
+++ trunk/web/reactos.org/htdocs/roscms/logon/login.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,0 +1,233 @@
+<?php
+ /*
+ RosCMS - ReactOS Content Management System
+ Copyright (C) 2005 Klemens Friedl <frik85 at reactos.org>
+ Ge van Geldorp <gvg at reactos.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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+// To prevent hacking activity:
+if ( !defined('ROSCMS_LOGIN') )
+{
+ die("Hacking attempt");
+}
+
+require_once("subsys_login.php");
+
+
+/*
+ * User Settings:
+ *
+ * user_setting_multisession == "true" (default: false) [multi sessions are allowed for this user]
+ * user_setting_browseragent == "true" (default: true) [no one should deactivate ("false") this option or only if he change the user agent very often (e.g. in opera: IE <=> Opera)]
+ * user_setting_ipaddress == "true" (default: true) [IP address check; avoid this setting if the user is behind a proxy or use more than one pc the same time (a possible security risk, but some persons wanted that behavior ...); Note: this is a per user setting, everyone can change it!]
+ * user_setting_timeout == "true" (default: false) [NO timeout; so user can use the ros homepage systems without to login everytime]
+ *
+ */
+
+// Intern Member Groups: (set all to false)
+$roscms_intern_usrgrp_sadmin = false;
+$roscms_intern_usrgrp_admin = false;
+$roscms_intern_usrgrp_dev = false;
+$roscms_intern_usrgrp_team = false;
+$roscms_intern_usrgrp_men = false;
+$roscms_intern_usrgrp_transm = false;
+$roscms_intern_usrgrp_trans = false;
+$roscms_intern_usrgrp_user = false;
+
+global $roscms_intern_usrgrp_sadmin;
+global $roscms_intern_usrgrp_admin;
+global $roscms_intern_usrgrp_deve;
+global $roscms_intern_usrgrp_team;
+global $roscms_intern_usrgrp_men;
+global $roscms_intern_usrgrp_transm;
+global $roscms_intern_usrgrp_trans;
+global $roscms_intern_usrgrp_user;
+
+
+
+$roscms_intern_login_check = "";
+$roscms_intern_login_check_usrgroup = "";
+$roscms_intern_account_group = "";
+$roscms_intern_account_level = "";
+
+
+$target = $_SERVER[ 'PHP_SELF' ];
+if ( IsSet( $_SERVER[ 'QUERY_STRING' ] ) ) {
+ $target .= '?' . $_SERVER[ 'QUERY_STRING' ];
+}
+$roscms_currentuser_id = roscms_subsys_login("roscms",
+ ROSCMS_LOGIN_REQUIRED,
+ $target);
+if (0 == $roscms_currentuser_id) {
+ die("login.php: unexpected return from roscms_subsys_login");
+}
+
+$query = "SELECT user_id, " .
+ " user_name, " .
+ " user_roscms_password, " .
+ " user_timestamp_touch, " .
+ " user_setting_timeout " .
+ " FROM users " .
+ " WHERE user_id = " .
+ $roscms_currentuser_id;
+$query_usr = mysql_query($query)
+ or die('DB error (login script #1)!');
+$result_usr = mysql_fetch_array($query_usr)
+ or die('DB error (login script #2)');
+
+if ($result_usr['user_name'] != "") {
+ $roscms_intern_timeout_option = $result_usr['user_setting_timeout'];
+}
+else { // only hacker/cracker/script kiddy/brute force script/bot/etc. is able to reach this part
+ die("<blink>No valid user session found!</blink><p><a href='http://www.reactos.org/roscms/?page=getpwd'>Delete all old sessions and login again!</a> (this function will also allow you to set a new password)</p>");
+ // TODO: add it to the watchlist!
+}
+
+if (isset($_POST['logout'])) {
+ header("location:?page=logout");
+}
+
+$querya = "SELECT user_login_counter, user_account_enabled, " .
+ " user_setting_multisession, " .
+ " user_setting_browseragent, user_setting_ipaddress " .
+ " FROM users " .
+ " WHERE user_id = $roscms_currentuser_id";
+$login_usr_keya_query = mysql_query($querya)
+ or die('DB error (login)!');
+$login_usr_keya_result = mysql_fetch_array($login_usr_keya_query);
+
+$roscms_currentuser_login_counter = $login_usr_keya_result['user_login_counter'];
+$roscms_currentuser_login_user_account_enabled = $login_usr_keya_result['user_account_enabled'];
+$roscms_currentuser_login_user_setting_multisession = $login_usr_keya_result['user_setting_multisession'];
+$roscms_currentuser_login_user_setting_browseragent = $login_usr_keya_result['user_setting_browseragent'];
+$roscms_currentuser_login_user_setting_ipaddress = $login_usr_keya_result['user_setting_ipaddress'];
+
+// if the account is NOT enabled; e.g. a reason could be that a member
+// of the admin group has disabled this account because of spamming,
+// etc.
+if ($roscms_currentuser_login_user_account_enabled != "yes") {
+ die("Account is not enabled!<br><br>System message: " .
+ $roscms_currentuser_login_user_account_enabled);
+}
+
+
+$roscms_security_level = 0;
+$roscms_security_memberships = "|";
+
+
+$rdf_user_id = $roscms_currentuser_id;
+$rdf_user_name = "FOO BAR";
+$rdf_user_level = 4;
+$rdf_user_timezone = 1;
+$rdf_user_timezone_name = "CET";
+
+
+
+// check usergroup membership
+$query = "SELECT * " .
+ " FROM usergroup_members " .
+ " WHERE usergroupmember_userid = $roscms_currentuser_id";
+$roscms_login_usrgrp_member_query = mysql_query($query);
+while($roscms_login_usrgrp_member_list = mysql_fetch_array($roscms_login_usrgrp_member_query)) {
+ switch ($roscms_login_usrgrp_member_list['usergroupmember_usergroupid']) { // Membership
+ case "user": // normal user
+ $roscms_intern_usrgrp_user = true;
+ break;
+ case "transmaint": // translation maintainer
+ case "translator": // translator
+ $roscms_intern_usrgrp_trans = true;
+ break;
+ case "m_lang": // language maintainer
+ $roscms_intern_usrgrp_transm = true;
+ break;
+ case "m_en": // maintainer for english (original language)
+ $roscms_intern_usrgrp_men = true;
+ break;
+ case "moderator": // moderator
+ case "mediateam": // mediateam (add here all other team's but not the 'web-team' => admin-group)
+ $roscms_intern_usrgrp_team = true;
+ break;
+ case "developer": // developer
+ $roscms_intern_usrgrp_dev = true;
+ break;
+ case "ros_admin": // administrator
+ $roscms_intern_usrgrp_admin = true;
+ break;
+ case "ros_sadmin": // super administrator (if someone is member of this group he is also a member of the normal admin group!)
+ $roscms_intern_usrgrp_admin = true;
+ $roscms_intern_usrgrp_sadmin = true;
+ break;
+ default: // nothing
+ break;
+ }
+
+
+ $query_usergroup = mysql_query("SELECT *
+ FROM usergroups
+ WHERE usrgroup_name_id = '".mysql_real_escape_string($roscms_login_usrgrp_member_list['usergroupmember_usergroupid'])."'
+ LIMIT 1;");
+ $result_usergroup = mysql_fetch_array($query_usergroup);
+
+ if ($result_usergroup['usrgroup_seclev'] > $roscms_security_level) {
+ $roscms_security_level = $result_usergroup['usrgroup_seclev'];
+ }
+
+ $roscms_security_memberships .= $roscms_login_usrgrp_member_list['usergroupmember_usergroupid']."|";
+
+}
+
+// Account level:
+
+if ($roscms_intern_usrgrp_sadmin == true) {
+ $roscms_intern_account_level = 100;
+}
+else {
+ if ($roscms_intern_usrgrp_admin == true) {
+ $roscms_intern_account_level = 75;
+ }
+ else {
+ if ($roscms_intern_usrgrp_dev == true) {
+ $roscms_intern_account_level = 50;
+ }
+ else {
+ if ($roscms_intern_usrgrp_team == true ||
+ $roscms_intern_usrgrp_trans == true ||
+ $roscms_intern_usrgrp_transm == true ||
+ $roscms_intern_usrgrp_men == true)
+ {
+ $roscms_intern_account_level = 25;
+ }
+ else {
+ $roscms_intern_account_level = 0;
+ }
+ }
+ }
+}
+
+//require_once("usergroups.php");
+
+
+// user id
+$roscms_intern_account_id = $roscms_currentuser_id;
+$roscms_intern_login_check_username=$result_usr['user_name'];
+
+// quick hack to test RosCMS; the following vars will change soon
+$roscms_intern_login_check_usrgroup = "ros_sadmin";
+$roscms_intern_account_group = "ros_sadmin";
+$roscms_intern_login_check = "valid"; // valid login sequenze
+
+?>
Added: trunk/web/reactos.org/htdocs/roscms/logon/login_optional.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/logon/login_optional.php?rev=36535&view=auto
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/logon/login_optional.php (added)
+++ trunk/web/reactos.org/htdocs/roscms/logon/login_optional.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,0 +1,66 @@
+<?php
+ /*
+ ReactOS DynamicFrontend (RDF)
+ Copyright (C) 2007 Klemens Friedl <frik85 at reactos.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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+ if ( !defined('ROSCMS_LOGIN') )
+ {
+ die("Hacking attempt");
+ }
+
+ require_once("logon/subsys_login.php");
+
+ $rdf_user_id = roscms_subsys_login('', ROSCMS_LOGIN_OPTIONAL, "");
+
+ if ($rdf_user_id == 0) {
+ $rdf_user_id = 0;
+ $rdf_user_name = "Anonymous Guest";
+ $rdf_user_level = 0; // 0 = guest, 1 = registered user, 2 = membership, 3 = moderator, 4 = author, 5 = admin
+ $rdf_user_timezone = 0;
+ $rdf_user_timezone_name = "UTC";
+ }
+ else {
+ $sql_user = "SELECT u.user_id, u.user_name, u.user_level, u.user_timezone, z.tz_code, z.tz_value
+ FROM users u, user_timezone z
+ WHERE u.user_id = ".mysql_real_escape_string($rdf_user_id)."
+ AND u.user_account_enabled LIKE 'yes'
+ AND u.user_timezone = z.tz_code
+ LIMIT 1;";
+ $query_user = mysql_query($sql_user);
+ $result_user = mysql_fetch_array($query_user);
+
+ if ($result_user['user_id'] != "" && $result_user['user_id'] > 1 && $result_user['user_level'] >= 1 && $result_user['user_level'] <= 5) {
+ $rdf_user_id = $result_user['user_id'];
+ $rdf_user_name = $result_user['user_name'];
+ $rdf_user_level = $result_user['user_level'];
+ $rdf_user_timezone = $result_user['tz_value'];
+ $rdf_user_timezone_name = $result_user['tz_code'];
+ }
+ else {
+ $rdf_user_id = 0;
+ $rdf_user_name = "Anonymous Guest";
+ $rdf_user_level = 0;
+ $rdf_user_timezone = 0;
+ $rdf_user_timezone_name = "UTC";
+ }
+ }
+
+
+
+
+?>
Propchange: trunk/web/reactos.org/htdocs/roscms/logon/login_optional.php
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/web/reactos.org/htdocs/roscms/logon/logon.css
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/logon/logon.css?rev=36535&view=auto
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/logon/logon.css (added)
+++ trunk/web/reactos.org/htdocs/roscms/logon/logon.css [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,0 +1,120 @@
+.login-form {
+ margin-top: 20px;
+ margin-bottom: 20px;
+}
+
+.login-form label {
+ color:#817A71;
+ display:block;
+ float:none;
+ font-size:105%;
+ font-weight:bold;
+ margin:0.7em 0pt 0.1em;
+}
+
+.login-form input {
+ background:#FFFADB url(../images/form-back.gif) repeat-x scroll 0%;
+ border:1px solid #CBB945;
+ color:#776B1B;
+ font-size:125%;
+ font-weight:normal;
+ width:200px;
+ padding:3px 7px;
+ line-height:1;
+}
+
+.login-form select {
+ background:#FFFADB;
+ border:1px solid #CBB945;
+ color:#776B1B;
+ font-size:115%;
+ font-weight:normal;
+ width:216px;
+ padding:3px 7px;
+ line-height:1;
+}
+
+.login-title {
+ font-size:150%;
+ font-weight:bold;
+ padding: 5px;
+}
+
+.login-options {
+ text-align:left;
+ margin-top: 20px;
+ margin-bottom: 10px;
+ padding: 10px;
+ color:#817A71;
+ font-size:105%;
+ font-weight:bold;
+}
+
+.login-button input {
+ font-size:120%;
+ margin-bottom: 10px;
+}
+
+.register-accept {
+ margin-top: 10px;
+ margin-bottom: 10px;
+}
+.register-accept a {
+ color:#000000 !important;
+ text-decoration:none;
+ font-style:italic;
+}
+
+.corner1 {
+ background:transparent url(../images/ul.gif) no-repeat scroll left top;
+}
+.corner2 {
+ background:transparent url(../images/ll.gif) no-repeat scroll left bottom;
+}
+.corner3 {
+ background:transparent url(../images/ur.gif) no-repeat scroll right top;
+}
+.corner4 {
+ background:transparent url(../images/lr.gif) no-repeat scroll right bottom;
+}
+
+
+/* profil headline */
+.u-h1 {
+ font-size: 150%;
+ font-weight:bold;
+ margin-bottom:15px;
+}
+.u-h2 {
+ font-size: 100%;
+ margin-bottom:30px;
+}
+
+.u-desc {
+ color:#817A71;
+ display:block;
+ float:none;
+ font-size:105%;
+ font-weight:bold;
+ margin:0.7em 0pt 0.1em;
+}
+
+.u-title {
+ font-size:130%;
+ font-weight:bold;
+ padding: 5px;
+}
+
+.u-title a {
+ font-size:95%;
+ font-weight:bold;
+ padding: 5px;
+ color:#000000 !important;
+}
+
+
+.u-link a {
+ color:#000000 !important;
+ font-size:110%;
+ font-weight:bold;
+}
Propchange: trunk/web/reactos.org/htdocs/roscms/logon/logon.css
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/web/reactos.org/htdocs/roscms/logon/logout.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/logon/logout.php?rev=36535&view=auto
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/logon/logout.php (added)
+++ trunk/web/reactos.org/htdocs/roscms/logon/logout.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,0 +1,60 @@
+<?php
+ /*
+ RosCMS - ReactOS Content Management System
+ Copyright (C) 2005 Ge van Geldorp <gvg at reactos.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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+// To prevent hacking activity:
+if ( !defined('ROSCMS_LOGIN') )
+{
+ die("Hacking attempt");
+}
+
+global $roscms_SET_path_ex;
+global $rdf_login_cookie_usrkey;
+
+//require_once("logon_utils.php");
+
+if (isset($_COOKIE[$rdf_login_cookie_usrkey]))
+{
+ $del_session_id = $_COOKIE[$rdf_login_cookie_usrkey];
+ setcookie($rdf_login_cookie_usrkey, "", time() - 3600, "/", cookie_domain());
+ $logout_usr_key_post = "DELETE FROM user_sessions " .
+ " WHERE usersession_id = '" .
+ mysql_escape_string($del_session_id) .
+ "'";
+ $logout_usr_key_post_list = mysql_query($logout_usr_key_post)
+ or die("DB error (logout)!");
+}
+
+
+$target = $_SERVER[ 'PHP_SELF' ];
+if ( IsSet( $_SERVER[ 'QUERY_STRING' ] ) ) {
+ $target .= '?' . $_SERVER[ 'QUERY_STRING' ];
+}
+if (isset($_REQUEST['target'])) {
+ header("Location: http://" . $_SERVER['HTTP_HOST'] .
+ $_REQUEST['target']);
+ exit;
+}
+
+header("Location: ".$roscms_SET_path_ex);
+
+exit;
+
+?>
Added: trunk/web/reactos.org/htdocs/roscms/logon/subsys_login.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/roscms/logon/subsys_login.php?rev=36535&view=auto
==============================================================================
--- trunk/web/reactos.org/htdocs/roscms/logon/subsys_login.php (added)
+++ trunk/web/reactos.org/htdocs/roscms/logon/subsys_login.php [iso-8859-1] Fri Sep 26 06:54:49 2008
@@ -1,0 +1,147 @@
+<?php
+ /*
+ RosCMS - ReactOS Content Management System
+ Copyright (C) 2005 Ge van Geldorp <gvg at reactos.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.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+require_once("/web/reactos.org/htdocs/roscms/inc/utils.php");
+
+define('ROSCMS_LOGIN_OPTIONAL', 1);
+define('ROSCMS_LOGIN_REQUIRED', 2);
+
+function roscms_subsys_login($subsys, $login_type, $target)
+{
+ if (ROSCMS_LOGIN_OPTIONAL != $login_type &&
+ ROSCMS_LOGIN_REQUIRED != $login_type)
+ {
+ die("Invalid login_type $login_type for roscms_subsys_login");
+ }
+
+ if (isset($_COOKIE['roscmsusrkey']) &&
+ preg_match('/^([a-z]{32})$/', $_COOKIE['roscmsusrkey'], $matches))
+ {
+ $session_id_clean = $matches[1];
+
+ if (isset($_SERVER['REMOTE_ADDR']) &&
+ preg_match('/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/',
+ $_SERVER['REMOTE_ADDR'], $matches) )
+ {
+ $remote_addr_clean = $matches[1];
+ }
+ else
+ {
+ $remote_addr_clean = 'invalid';
+ }
+ if (isset($_SERVER['HTTP_USER_AGENT']))
+ {
+ $browser_agent_clean = $_SERVER['HTTP_USER_AGENT'];
+ }
+ else
+ {
+ $browser_agent_clean = 'unknown';
+ }
+
+ require("connect.db.php");
+
+ /* Clean out expired sessions */
+ $query = "DELETE FROM user_sessions " .
+ " WHERE usersession_expires IS NOT NULL " .
+ " AND usersession_expires < NOW()";
+ mysql_query($query, $connect);
+
+ /* Now, see if we have a valid login session */
+ $bulk_of_where = " WHERE s.usersession_id = '" .
+ mysql_escape_string($session_id_clean) . "' " .
+ " AND u.user_id = s.usersession_user_id " .
+ " AND (u.user_setting_ipaddress = 'false' OR " .
+ " s.usersession_ipaddress = '" .
+ mysql_escape_string($remote_addr_clean) . "') " .
+ " AND (u.user_setting_browseragent = 'false' OR " .
+ " s.usersession_browseragent = '" .
+ mysql_escape_string($browser_agent_clean) . "') ";
+ if ($subsys == "roscms" || $subsys == "")
+ {
+ $query = "SELECT u.user_id, s.usersession_expires " .
+ " FROM roscms.user_sessions s, " .
+ " roscms.users u " .
+ $bulk_of_where;
+ }
+ else
+ {
+ $query = "SELECT m.map_subsys_userid, s.usersession_expires " .
+ " FROM roscms.user_sessions s, " .
+ " roscms.users u, " .
+ " roscms.subsys_mappings m " .
+ $bulk_of_where .
+ " AND m.map_roscms_userid = s.usersession_user_id " .
+ " AND m.map_subsys_name = '" .
+ mysql_escape_string($subsys) . "'";
+ }
+ $statement = mysql_query($query, $connect)
+ or die('DB error (user login) ' . $query);
+
+ if ($row = mysql_fetch_array($statement))
+ {
+ /* Login session found */
+ $userid = $row[0];
+
+ // For the Wiki, we have to start a session
+ if( $subsys == "wiki" )
+ {
+ define('MEDIAWIKI', '');
+ require_once("../wiki/includes/GlobalFunctions.php");
+ wfSetupSession();
+ }
+
+ if (isset($row[1]))
+ {
+ /* Session with timeout. Update the expiry time in the table and
+ the expiry time of the cookie */
+ $query = "UPDATE roscms.user_sessions " .
+ " SET usersession_expires = DATE_ADD(NOW(), INTERVAL 30 MINUTE) " .
+ " WHERE usersession_id = '" .
+ mysql_escape_string($session_id_clean) . "'";
+ mysql_query($query, $connect);
+ setcookie('roscmsusrkey', $session_id_clean,
+ time() + 60 * 60, '/', cookie_domain());
+ }
+ }
+ else
+ {
+ $userid = 0;
+ }
+ }
+ else
+ {
+ $userid = 0;
+ }
+
+ if (0 == $userid && ROSCMS_LOGIN_REQUIRED == $login_type)
+ {
+ $url = "/roscms/?page=login";
+ if ("" != $target)
+ {
+ $url .= "&target=" . urlencode($target);
+ }
+ header("Location: $url");
+ exit;
+ }
+
+ return $userid;
+}
+
+?>
Propchange: trunk/web/reactos.org/htdocs/roscms/logon/subsys_login.php
------------------------------------------------------------------------------
svn:eol-style = native
More information about the Ros-diffs
mailing list