[jasmine-commit] SF.net SVN: newsphp: [134] trunk/jasmine
Brought to you by:
christoph_berg,
red-
|
From: <Re...@us...> - 2007-09-06 17:23:02
|
Revision: 134
http://newsphp.svn.sourceforge.net/newsphp/?rev=134&view=rev
Author: Red-
Date: 2007-09-06 10:23:01 -0700 (Thu, 06 Sep 2007)
Log Message:
-----------
-- null
Modified Paths:
--------------
trunk/jasmine/classes/Core.class.php
trunk/jasmine/classes/ExtensionManager.class.php
trunk/jasmine/classes/Logger.class.php
trunk/jasmine/classes/Session.Class.php
trunk/jasmine/classes/User.class.php
trunk/jasmine/index.php
trunk/jasmine/modules/DB/DB.class.php
trunk/jasmine/templatesets/Jasmine/Jasmine.template.php
trunk/jasmine/templatesets/Jasmine/templates/Footer.htm
trunk/jasmine/templatesets/Jasmine/templates/Header.htm
Modified: trunk/jasmine/classes/Core.class.php
===================================================================
--- trunk/jasmine/classes/Core.class.php 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/classes/Core.class.php 2007-09-06 17:23:01 UTC (rev 134)
@@ -85,7 +85,7 @@
*
* @return Core Reference to single Core instance
*/
- public static function &getSingleton()
+ public static function getSingleton()
{
// Check if an instance exists
if (is_null(self::$Instance))
@@ -94,7 +94,7 @@
$c = __CLASS__;
self::$Instance = new $c;
-
+
// Load the extensions
ExtensionManager::getSingleton()->loadExtensions();
Modified: trunk/jasmine/classes/ExtensionManager.class.php
===================================================================
--- trunk/jasmine/classes/ExtensionManager.class.php 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/classes/ExtensionManager.class.php 2007-09-06 17:23:01 UTC (rev 134)
@@ -282,13 +282,13 @@
// Check, if extension type is known
if (!array_key_exists($type, $this->Extensions))
{
- throw new NoSuchExtensionTypeException($type);
+ throw new NoSuchExtensionTypeException($name, $type);
}
// Check, if an extension with the specified name can be found
if (!array_key_exists($name, $this->Extensions[$type]))
{
- throw new NoSuchExtensionException($name);
+ throw new NoSuchExtensionException($name, $type);
}
return $this->Extensions[$type][$name];
Modified: trunk/jasmine/classes/Logger.class.php
===================================================================
--- trunk/jasmine/classes/Logger.class.php 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/classes/Logger.class.php 2007-09-06 17:23:01 UTC (rev 134)
@@ -67,7 +67,7 @@
parent::__construct();
// Open handle to logfile
- if (!($this->LogHandle = fopen('./jasmine.log', 'wx+')))
+ if (!($this->LogHandle = fopen('./jasmine.log', 'rw+')))
{
throw new FileIOException('./jasmine.log');
}
Modified: trunk/jasmine/classes/Session.Class.php
===================================================================
--- trunk/jasmine/classes/Session.Class.php 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/classes/Session.Class.php 2007-09-06 17:23:01 UTC (rev 134)
@@ -108,14 +108,14 @@
*/
public function logout()
{
- $Session_SQL = $this->db->query('SELECT * FROM '. SESSIONS_TABLE .' WHERE Session_ID = \''. $_SESSION['ID'] .'\'');
+ $Session_SQL = $this->db->query('SELECT * FROM jasmine_sessions WHERE Session_ID = \''. $_SESSION['ID'] .'\'');
while($Session = $this->db->getRows($Session_SQL))
{
- $User = $this->db->getRows($this->db->query('SELECT * FROM '. USERS_TABLE .' WHERE ID = \''. $_SESSION['UserID'] .'\''));
+ $User = $this->db->getRows($this->db->query('SELECT Total_time FROM jasmine_users WHERE ID = \''. $_SESSION['UserID'] .'\''));
// Get User Data, Update
$NewTime = $User['Total_time'] + ($Session['Session_End'] - $Session['Session_Start']);
- $this->db->query('UPDATE '. USERS_TABLE .' SET Total_time = \''. $NewTime .'\'');
+ $this->db->query('UPDATE jasmine_users SET Total_time = \''. $NewTime .'\'');
// Then Kill It. Kill It Dead.
$this->haltSession('User', $_SESSION['UserID']);
@@ -140,10 +140,10 @@
$this->setValue('UserID', $User);
// Update Certain User Info
- $this->db->query('UPDATE '. USERS_TABLE .' SET LoginNumber=LoginNumber+1,LastOn = \''.time().'\' WHERE ID = \'' . $User . '\'');
+ $this->db->query('UPDATE jasmine_users SET LoginNumber=LoginNumber+1,LastOn = \''.time().'\' WHERE ID = \'' . $User . '\'');
// Update Session WIth User ID
- $this->db->query('UPDATE '. SESSIONS_TABLE .' SET User = \''. $User .'\' WHERE Session_ID = \''. $_SESSION['ID'] . '\'');
+ $this->db->query('UPDATE jasmine_sessions SET User = \''. $User .'\' WHERE Session_ID = \''. $_SESSION['ID'] . '\'');
// Update Session
$this->updateSession();
@@ -175,7 +175,7 @@
*/
private function exists($key, $value)
{
- $S_Query = $this->db->query('SELECT * FROM '. SESSIONS_TABLE .' WHERE '. $key .' = \''. $value . '\'');
+ $S_Query = $this->db->query('SELECT * FROM jasmine_sessions WHERE '. $key .' = \''. $value . '\'');
if($this->db->numRows($S_Query) != 0)
{
@@ -192,7 +192,7 @@
private function createEntry()
{
// Get Session Vars
- $Session_ID = Core::getSingleton()->getNextID(SESSIONS_TABLE, 'Session_ID');
+ $Session_ID = Core::getSingleton()->getNextID('jasmine_sessions', 'Session_ID');
$Session_Time = time();
// Set $_SESSION Vars
@@ -200,7 +200,7 @@
$this->setValue('Time', $Session_Time);
// Insert into datanase
- $this->db->query('INSERT INTO '. SESSIONS_TABLE .' (Session_ID, Session_Start, Session_End, Session_Key, User)
+ $this->db->query('INSERT INTO jasmine_sessions (Session_ID, Session_Start, Session_End, Session_Key, User)
VALUES (\'' . $Session_ID . '\', \''. $Session_Time .'\', \''. $Session_Time .'\', \''. $this->SessionKey . '\', \''. $UserID .'\')');
}
@@ -231,7 +231,7 @@
}
// Insert into datanase
- $this->db->query('INSERT INTO '. SESSIONS_TABLE .' (Session_ID, Session_Start, Session_End, Session_Key, User)
+ $this->db->query('INSERT INTO jasmine_sessions (Session_ID, Session_Start, Session_End, Session_Key, User)
VALUES (\'' . $Session_ID . '\', \''. $Session_Time .'\', \''. $Session_Time .'\', \''. $this->SessionKey . '\', \''. $UserID .'\')');
}
@@ -242,7 +242,7 @@
private function createWithID()
{
// Insert into datanase
- $this->db->query('UPDATE '. SESSIONS_TABLE .' SET Session_Key = \''. $this->SessionKey . '\' WHERE Session_ID = \''. $_SESSION['ID'].'\'');
+ $this->db->query('UPDATE jasmine_sessions SET Session_Key = \''. $this->SessionKey . '\' WHERE Session_ID = \''. $_SESSION['ID'].'\'');
}
/**
* If the IP is inserted in the db
@@ -251,7 +251,7 @@
private function createFromKey()
{
// Get Session Query
- $Query = $this->db->query('SELECT * FROM '. SESSIONS_TABLE .' WHERE Session_Key = \''. $this->SessionKey . '\'');
+ $Query = $this->db->query('SELECT * FROM jasmine_sessions WHERE Session_Key = \''. $this->SessionKey . '\'');
$Result = $this->db->getRows($Query);
// Get Session Vars
@@ -275,7 +275,7 @@
$_SESSION['Time'] = time();
// Update session db time
- $this->db->query('UPDATE '. SESSIONS_TABLE .' SET Session_End = \''. time() .'\' WHERE Session_ID = \''. $_SESSION['ID'] . '\'');
+ $this->db->query('UPDATE jasmine_sessions SET Session_End = \''. time() .'\' WHERE Session_ID = \''. $_SESSION['ID'] . '\'');
// Handle Sessions
$this->handleSessions();
@@ -290,7 +290,7 @@
private function handleSessions()
{
// Gather the SQL for all sessions
- $Session_SQL = $this->db->query('SELECT * FROM '. SESSIONS_TABLE .' JOIN '.USERS_TABLE .'');
+ $Session_SQL = $this->db->query('SELECT * FROM jasmine_sessions JOIN jasmine_users');
while($Session = $this->db->getRows($Session_SQL))
{
// 10 minute time out
@@ -300,7 +300,7 @@
if($Session['User'] != '0')
{
$NewTime = $Session['Total_time'] + ($Session['Session_End'] - $Session['Session_Start']);
- $this->db->query('UPDATE '. USERS_TABLE .' SET Total_time = \''. $NewTime .'\'');
+ $this->db->query('UPDATE jasmine_users SET Total_time = \''. $NewTime .'\'');
}
$this->haltSession('Session_ID', $Session['Session_ID']);
@@ -318,7 +318,7 @@
*/
private function haltSession($Field, $ID)
{
- $this->db->query('DELETE FROM '. SESSIONS_TABLE .' WHERE '. $Field .' = \''. $ID . '\'');
+ $this->db->query('DELETE FROM jasmine_sessions WHERE '. $Field .' = \''. $ID . '\'');
}
/**
Modified: trunk/jasmine/classes/User.class.php
===================================================================
--- trunk/jasmine/classes/User.class.php 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/classes/User.class.php 2007-09-06 17:23:01 UTC (rev 134)
@@ -77,7 +77,7 @@
private function Auth($User, $Pass, $Form)
{
// Start Check Query
- $CheckAuth = $this->db->query('SELECT * FROM ' . USERS_TABLE . ' WHERE Username = \'' . $User . '\' AND Password = \'' . md5($Pass) . '\'');
+ $CheckAuth = $this->db->query('SELECT * FROM jasmine_users WHERE Username = \'' . $User . '\' AND Password = \'' . md5($Pass) . '\'');
if($this->db->numRows($CheckAuth) != 0)
{
@@ -157,8 +157,8 @@
*/
private function loadPermissions()
{
- $this->permissions['Group'] = $this->db->query('SELECT * FROM '.GROUP_PERMISSIONS_TABLE.' WHERE gid = \''. $this->Userdata['Group'] .'\'');
- $this->permissions['User'] = $this->db->query('SELECT * FROM '.USERS_PERMISSIONS_TABLE.' WHERE uid = \''. $this->Userdata['ID'] .'\'');
+ $this->permissions['Group'] = $this->db->query('SELECT * FROM jasmine_permissions_groups WHERE gid = \''. $this->Userdata['Group'] .'\'');
+ $this->permissions['User'] = $this->db->query('SELECT * FROM jasmin_permissions_users WHERE uid = \''. $this->Userdata['ID'] .'\'');
while(list($Type) = each($this->permissions))
{
@@ -201,4 +201,4 @@
session_unset();
}
}
-?>
\ No newline at end of file
+?>
Modified: trunk/jasmine/index.php
===================================================================
--- trunk/jasmine/index.php 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/index.php 2007-09-06 17:23:01 UTC (rev 134)
@@ -12,7 +12,6 @@
Core::setXmlParser(new DomXmlParser());
print_r(Core::getSingleton());
-
// =====================================================
// The pages we have to choose
//
Modified: trunk/jasmine/modules/DB/DB.class.php
===================================================================
--- trunk/jasmine/modules/DB/DB.class.php 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/modules/DB/DB.class.php 2007-09-06 17:23:01 UTC (rev 134)
@@ -129,7 +129,7 @@
//$this->m_queries[$this->m_numQueries] = $query;
try {
- return $this->m_DB->query($query);
+ // return $this->m_DB->query($query);
}
catch (PDOException $e)
{
@@ -162,14 +162,28 @@
}
}
- $stmt =& $this->m_DB->prepare($sql);
- $stmt->execute();
- $rows =& $stmt->fetchAll(PDO::FETCH_ASSOC);
+ //$stmt =& $this->m_DB->prepare($sql);
+ //$stmt->execute();
+ //$rows =& $stmt->fetchAll(PDO::FETCH_ASSOC);
return $rows;
}
/**
+ *
+ * the numRows() function
+ *
+ * In beta testing with PDO, jerry-rigged.
+ *
+ * More documentation to come
+ */
+ public function numRows($sql)
+ {
+ $numRowsQuery = $this->getRows($this->query($sql));
+ return sizeof($numRowsQuery);
+ }
+
+ /**
* Intialises the connections with from the DB to other modules
*/
public function initialiseConnections()
Modified: trunk/jasmine/templatesets/Jasmine/Jasmine.template.php
===================================================================
--- trunk/jasmine/templatesets/Jasmine/Jasmine.template.php 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/templatesets/Jasmine/Jasmine.template.php 2007-09-06 17:23:01 UTC (rev 134)
@@ -48,12 +48,12 @@
public function header()
{
// Load The Template File
- $template->set_filenames(array(
+ Template::getSingleton()->setFilenames(array(
'header' => 'Header.htm')
);
// Assign Template Variables
- $template->assign_vars(array(
+ Template::getSingleton()->assignVars(array(
'CSS_PATH' => 'PATH TO CSS',)
);
Modified: trunk/jasmine/templatesets/Jasmine/templates/Footer.htm
===================================================================
--- trunk/jasmine/templatesets/Jasmine/templates/Footer.htm 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/templatesets/Jasmine/templates/Footer.htm 2007-09-06 17:23:01 UTC (rev 134)
@@ -1,7 +0,0 @@
- </div>
- <div class="copyright" style="clear:left; padding-top:20px;">
- {COPYRIGHT} {VERSION}<br />
- [ Script Execution Time: {LOADTIME} ] [ DB Queries: {QUERIES} ]
- </div>
- </body>
-</html>
\ No newline at end of file
Modified: trunk/jasmine/templatesets/Jasmine/templates/Header.htm
===================================================================
--- trunk/jasmine/templatesets/Jasmine/templates/Header.htm 2007-08-31 18:44:07 UTC (rev 133)
+++ trunk/jasmine/templatesets/Jasmine/templates/Header.htm 2007-09-06 17:23:01 UTC (rev 134)
@@ -1,10 +1,14 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Jasmine - Administration Center</title>
<link href="{CSS_PATH}" rel="stylesheet" type="text/css" />
</head>
<body>
- <div id="border">
\ No newline at end of file
+ <div id="border">
+ </div>
+ <div class="copyright" style="clear:left; padding-top:20px;">
+ {COPYRIGHT} {VERSION}<br />
+ [ Script Execution Time: {LOADTIME} ] [ DB Queries: {QUERIES} ]
+ </div>
+ </body>
+</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|