[Cs-content-commits] SF.net SVN: cs-content:[349] releases/1.0
PHP Templating & Includes System
Brought to you by:
crazedsanity
|
From: <cra...@us...> - 2009-02-03 19:28:41
|
Revision: 349
http://cs-content.svn.sourceforge.net/cs-content/?rev=349&view=rev
Author: crazedsanity
Date: 2009-02-03 19:28:36 +0000 (Tue, 03 Feb 2009)
Log Message:
-----------
*** RELEASE 1.0-ALPHA4 ***
SUMMARY OF CHANGES:::
* rename cs_sessionClass.php to cs_session.class.php to match naming conventions.
* minor change to contentSystem so version parsing always works.
* minor require_once statement for session class so version stuff works.
SVN COMMAND:::
merge --depth=infinity -r343:HEAD https://cs-content.svn.sourceforge.net/svnroot/cs-content/trunk/1.0
Modified Paths:
--------------
releases/1.0/VERSION
releases/1.0/contentSystem.class.php
Added Paths:
-----------
releases/1.0/cs_session.class.php
Removed Paths:
-------------
releases/1.0/cs_sessionClass.php
Modified: releases/1.0/VERSION
===================================================================
--- releases/1.0/VERSION 2009-02-03 19:25:44 UTC (rev 348)
+++ releases/1.0/VERSION 2009-02-03 19:28:36 UTC (rev 349)
@@ -1,5 +1,5 @@
## Stores the current version of the cs-content system, and it's source. Please do NOT modify this file.
-VERSION: 1.0-ALPHA3
+VERSION: 1.0-ALPHA4
PROJECT: cs-content
$HeadURL$
\ No newline at end of file
Modified: releases/1.0/contentSystem.class.php
===================================================================
--- releases/1.0/contentSystem.class.php 2009-02-03 19:25:44 UTC (rev 348)
+++ releases/1.0/contentSystem.class.php 2009-02-03 19:28:36 UTC (rev 349)
@@ -72,7 +72,7 @@
require_once(dirname(__FILE__) ."/abstract/cs_content.abstract.class.php");
require_once(dirname(__FILE__) ."/cs_fileSystem.class.php");
-require_once(dirname(__FILE__) ."/cs_sessionClass.php");
+require_once(dirname(__FILE__) ."/cs_session.class.php");
require_once(dirname(__FILE__) ."/cs_genericPage.class.php");
require_once(dirname(__FILE__) ."/cs_tabs.class.php");
@@ -103,12 +103,12 @@
* The CONSTRUCTOR. Duh.
*/
public function __construct($testOnly=FALSE) {
+ parent::__construct();
if($testOnly === 'unit_test') {
//It's just a test, don't do anything we might regret later.
$this->isTest = TRUE;
}
else {
- parent::__construct();
//setup the section stuff...
$repArr = array($_SERVER['SCRIPT_NAME'], "/");
Copied: releases/1.0/cs_session.class.php (from rev 348, trunk/1.0/cs_session.class.php)
===================================================================
--- releases/1.0/cs_session.class.php (rev 0)
+++ releases/1.0/cs_session.class.php 2009-02-03 19:28:36 UTC (rev 349)
@@ -0,0 +1,145 @@
+<?php
+/*
+ * FILE INFORMATION:
+ * $HeadURL$
+ * $Id$
+ * $LastChangedDate$
+ * $LastChangedBy$
+ * $LastChangedRevision$
+ */
+
+require_once(dirname(__FILE__) ."/abstract/cs_content.abstract.class.php");
+require_once(dirname(__FILE__) ."/../cs-versionparse/cs_version.abstract.class.php");
+
+class cs_session extends cs_contentAbstract {
+
+ protected $db;
+ public $uid;
+ public $sid;
+ public $sid_check = 1;
+
+ //---------------------------------------------------------------------------------------------
+ /**
+ * The constructor.
+ *
+ * @param $createSession (mixed,optional) determines if a session will be started or not; if
+ * this parameter is non-null and non-numeric, the value will be
+ * used as the session name.
+ */
+ function __construct($createSession=1) {
+ parent::__construct(false);
+ if($createSession) {
+ if(!is_null($createSession) && strlen($createSession) && !is_numeric($createSession)) {
+ session_name($createSession);
+ }
+
+ //now actually create the session.
+ session_start();
+ }
+
+ //check if there's a uid in the session already.
+ //TODO: need a setting somewhere that says what the name of this var should be,
+ // instead of always forcing "uid".
+ $this->uid = 0;
+ if($_SESSION['uid']) {
+ $this->uid = $_SESSION['uid'];
+ }
+
+ //grab what our session_id is...
+ $this->sid = session_id();
+
+ }//end __construct()
+ //---------------------------------------------------------------------------------------------
+
+
+
+ //---------------------------------------------------------------------------------------------
+ /**
+ * Required method, so passing the object to contentSystem::handle_session()
+ * will work properly.
+ *
+ * @param (none)
+ *
+ * @return FALSE FAIL: user is not authenticated (hard-coded this way).
+ */
+ public function is_authenticated() {
+ return(FALSE);
+ }//end is_authenticated()
+ //---------------------------------------------------------------------------------------------
+
+
+
+ //---------------------------------------------------------------------------------------------
+ /**
+ * Retrieve data for an existing cookie.
+ *
+ * @param $name (string) Name of cookie to retrieve value for.
+ *
+ * @return NULL FAIL (?): cookie doesn't exist or has NULL value.
+ * @return (string) PASS: value of cookie.
+ */
+ public function get_cookie($name) {
+ $retval = NULL;
+ if(isset($_COOKIE) && $_COOKIE[$name]) {
+ $retval = $_COOKIE[$name];
+ }
+ return($retval);
+ }//end get_cookie()
+ //---------------------------------------------------------------------------------------------
+
+
+
+ //---------------------------------------------------------------------------------------------
+ /**
+ * Create a new cookie.
+ *
+ * @param $name (string) Name of cookie
+ * @param $value (string) value of cookie
+ * @param $expiration (string/number) unix timestamp or value for strtotime().
+ */
+ public function create_cookie($name, $value, $expiration=NULL) {
+
+ $expTime = NULL;
+ if(!is_null($expiration)) {
+ if(is_numeric($expiration)) {
+ $expTime = $expiration;
+ }
+ elseif(preg_match('/ /', $expiration)) {
+ $expTime = strtotime($expiration);
+ }
+ else {
+ throw new exception(__METHOD__ .": invalid timestamp given (". $expiration .")");
+ }
+ }
+
+ $retval = setcookie($name, $value, $expTime, '/');
+ return($retval);
+
+ }//end create_cookie()
+ //---------------------------------------------------------------------------------------------
+
+
+
+ //---------------------------------------------------------------------------------------------
+ /**
+ * Destroy (expire) an existing cookie.
+ *
+ * @param $name (string) Name of cookie to destroy
+ *
+ * @return FALSE FAIL: no cookie by that name.
+ * @return TRUE PASS: cookie destroyed.
+ */
+ public function drop_cookie($name) {
+ $retval = FALSE;
+ if(isset($_COOKIE[$name])) {
+ setcookie($name, $_COOKIE[$name], time() -10000, '/');
+ unset($_COOKIE[$name]);
+ $retval = TRUE;
+ }
+ return($retval);
+ }//end drop_cookie()
+ //---------------------------------------------------------------------------------------------
+
+
+}//end cs_session{}
+?>
\ No newline at end of file
Deleted: releases/1.0/cs_sessionClass.php
===================================================================
--- releases/1.0/cs_sessionClass.php 2009-02-03 19:25:44 UTC (rev 348)
+++ releases/1.0/cs_sessionClass.php 2009-02-03 19:28:36 UTC (rev 349)
@@ -1,144 +0,0 @@
-<?php
-/*
- * FILE INFORMATION:
- * $HeadURL$
- * $Id$
- * $LastChangedDate$
- * $LastChangedBy$
- * $LastChangedRevision$
- */
-
-require_once(dirname(__FILE__) ."/../cs-versionparse/cs_version.abstract.class.php");
-
-class cs_session extends cs_contentAbstract {
-
- protected $db;
- public $uid;
- public $sid;
- public $sid_check = 1;
-
- //---------------------------------------------------------------------------------------------
- /**
- * The constructor.
- *
- * @param $createSession (mixed,optional) determines if a session will be started or not; if
- * this parameter is non-null and non-numeric, the value will be
- * used as the session name.
- */
- function __construct($createSession=1) {
- parent::__construct(false);
- if($createSession) {
- if(!is_null($createSession) && strlen($createSession) && !is_numeric($createSession)) {
- session_name($createSession);
- }
-
- //now actually create the session.
- session_start();
- }
-
- //check if there's a uid in the session already.
- //TODO: need a setting somewhere that says what the name of this var should be,
- // instead of always forcing "uid".
- $this->uid = 0;
- if($_SESSION['uid']) {
- $this->uid = $_SESSION['uid'];
- }
-
- //grab what our session_id is...
- $this->sid = session_id();
-
- }//end __construct()
- //---------------------------------------------------------------------------------------------
-
-
-
- //---------------------------------------------------------------------------------------------
- /**
- * Required method, so passing the object to contentSystem::handle_session()
- * will work properly.
- *
- * @param (none)
- *
- * @return FALSE FAIL: user is not authenticated (hard-coded this way).
- */
- public function is_authenticated() {
- return(FALSE);
- }//end is_authenticated()
- //---------------------------------------------------------------------------------------------
-
-
-
- //---------------------------------------------------------------------------------------------
- /**
- * Retrieve data for an existing cookie.
- *
- * @param $name (string) Name of cookie to retrieve value for.
- *
- * @return NULL FAIL (?): cookie doesn't exist or has NULL value.
- * @return (string) PASS: value of cookie.
- */
- public function get_cookie($name) {
- $retval = NULL;
- if(isset($_COOKIE) && $_COOKIE[$name]) {
- $retval = $_COOKIE[$name];
- }
- return($retval);
- }//end get_cookie()
- //---------------------------------------------------------------------------------------------
-
-
-
- //---------------------------------------------------------------------------------------------
- /**
- * Create a new cookie.
- *
- * @param $name (string) Name of cookie
- * @param $value (string) value of cookie
- * @param $expiration (string/number) unix timestamp or value for strtotime().
- */
- public function create_cookie($name, $value, $expiration=NULL) {
-
- $expTime = NULL;
- if(!is_null($expiration)) {
- if(is_numeric($expiration)) {
- $expTime = $expiration;
- }
- elseif(preg_match('/ /', $expiration)) {
- $expTime = strtotime($expiration);
- }
- else {
- throw new exception(__METHOD__ .": invalid timestamp given (". $expiration .")");
- }
- }
-
- $retval = setcookie($name, $value, $expTime, '/');
- return($retval);
-
- }//end create_cookie()
- //---------------------------------------------------------------------------------------------
-
-
-
- //---------------------------------------------------------------------------------------------
- /**
- * Destroy (expire) an existing cookie.
- *
- * @param $name (string) Name of cookie to destroy
- *
- * @return FALSE FAIL: no cookie by that name.
- * @return TRUE PASS: cookie destroyed.
- */
- public function drop_cookie($name) {
- $retval = FALSE;
- if(isset($_COOKIE[$name])) {
- setcookie($name, $_COOKIE[$name], time() -10000, '/');
- unset($_COOKIE[$name]);
- $retval = TRUE;
- }
- return($retval);
- }//end drop_cookie()
- //---------------------------------------------------------------------------------------------
-
-
-}//end cs_session{}
-?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|