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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
|
<?php
require_once $_SERVER["DOCUMENT_ROOT"] . "/class/define/equate.php" ;
require_once $_SERVER['DOCUMENT_ROOT'] . "/class/newEnv.php";
require_once $_SERVER['DOCUMENT_ROOT'] . "/class/newScreen.php";
class Signon2 extends Skeleton
{
/**
* Skeleton Constructor
*
*/
function construct($debug)
{ $this->debug = $debug =true ; ////////////////////////////////////TTTTTTTTTTTTTTTTTTTTEEEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSSSSSSTTTTTTTTTTTTT
}
/**
* Skeleton Destructor
*
*/
function destruct( )
{ }
function execute()
{
/**
* Interception des événements de Signon (includes/signon.php)
* -----------------------------------------------------------
*/
if (isset($_POST["skelt_connection"]))
{ if ($this->__get(DEBUG))
user_error("skeleton[0]: connection asked!" , E_USER_NOTICE) ;
$this->connect() ;
}
if (isset($_POST["skelt_deconnection"]))
{ if ($this->__get(DEBUG))
user_error("skeleton[session_destroy]" , E_USER_NOTICE) ;
$this->disconnect() ;
}
}
/**
* Connect - Signon (includes/signon.php)
* ---------------------------------------
*/
function connect()
{ if ($this->debug)
user_error(">>>>>>>>>>>>>>>> Connection->connect <<<<<<<<<<<<<<<<<<<" , E_USER_NOTICE) ;
;
}
/**
* Disconnect - Signon (includes/signon.php)
* ------------------------------------------
*/
function disconnect()
{ if ($this->debug)
user_error(">>>>>>>>>>>>>>>> Disconnect <<<<<<<<<<<<<<<<<<<" , E_USER_NOTICE) ;
}
}
// ------------------------------------------------------------------------------------------------------------------------------- //
// ------------------------------------------------------------------------------------------------------------------------------- //
// ------------------------------------------------------------------------------------------------------------------------------- //
// --------------------------------- INSTANCIATION DU SKELET --------------------------------- //
// ------------------------------------------------------------------------------------------------------------------------------- //
// ------------------------------------------------------------------------------------------------------------------------------- //
// ------------------------------------------------------------------------------------------------------------------------------- //
class Skeleton
{ private $properties = array(), $dbEnv = array(), $param = array( ) ;
private $PTR_session, $debug ;
public static $Master, $Environ, $TBL_screen ;
/**
* Skeleton Constructor($PTR_session, $TBL_screen, $debug)
*
*/
==> line 155 public function __construct($PTR_session, $TBL_screen, $debug)
{ $this->PTR_session = $PTR_session ;
$this->TBL_screen = $TBL_screen ;
$this->debug = $debug ;
if ($this->debug)
{ user_error("Skeleton Starting" ,E_USER_NOTICE) ;
}
/**
* Skeleton Destructor
*
*/
public function __destruct()
{ if ($this->debug)
{ print("Skeleton Ending" . CRLF) ; }
}
/**
* Execute
*
*/
public function execute()
{ try { if ($this->debug)
{ print("Skeleton Executing" . CRLF) ;
print("===> Instanciating Environ" . CRLF );
}
/**
* Instanciation de la classe Environ (la classe DB est instanciée dans ENVIRON
* ----------------------------------------------------------------------------
*/
// function getInstance( $utf8=true, $debug=false )
$this->envInst = Environ::getInstance( $utf8=true, $debug=false ) ;
$this->envInst->execute() ;
/**
* Obtention des pointeurs des classes Environ et MYsql
* ----------------------------------------------------
*/
$this->dbEnv = $this->getEnvHandler() ;
$this->db = $this->getDBhandler() ;
$this->processDb() ;
// =====================================================================================================================
// A partir de ce point, cela fonctionne, mais les routines vont tjs chercher leurs paramètres dans DB plutôt qu'ENVIRON
// =====================================================================================================================
if ($this->debug)
{ print("==========> Instanciating Screen" . CRLF );
}
/**
* Instanciation de la classe Screen
* ---------------------------------
*/
$this->screenInst = Screen::getInstance($this->db, $this->TBL_screen, $debug=false) ;
$this->screenInst->execute() ;
// =========================================================================================================================
// A ce moment, mon input est soit inséré ou la page existante est éventuellement mise à jout, maintenant il faut l'afficher
// =========================================================================================================================
$this->displayPage() ;
/**
* Instanciation de la classe Signon et inteception éventuelle des événemets de Signin/login/Logout
* ------------------------------------------------------------------------------------------------
*/
==> ligne 226 $signon = new Signon2($this->debug) ;
$signon->execute() ;
} catch (Exception $E) {
die("SKELETON ERROR: " . $this->display_exception($E) . "<br/>");
}
}
/**
* Process DB
*
*/
function processDb()
{ $this->idConn = $this->db->dbConnect($debug=false,$utf8=true,$id='default') ;
}
/**
* Display Page
*
*/
function displayPage()
{
}
function getEnvHandler()
{ return( $this->envInst->getEnviron() ) ;}
function getDBhandler()
{ return(DB::$MYsql ) ; }
/**
* Execute
*
*/
function getInstance($PTR_session, $TBL_screen, $debug=false)
{ if (self::$Master == NULL)
if (self::$Master = new Skeleton($PTR_session, $TBL_screen, $debug=false) )
if (self::$Master->debug)
user_error("Constructor Skeleton OK !" , E_USER_NOTICE) ;
return(self::$Master) ;
}
// =============================================================================================================================== //
/**
* Magic prperties __set & $get
*
*/
function __get($property)
{ //if ($this->debug)
// user_error("__get used[".$property."]" , E_USER_NOTICE) ;
return( (isset($this->properties[$property])) ? $this->properties[$property] : NULL ) ;
}
function __set($property, $value)
{
//if ($this->debug)
//user_error("__set used[".$property."]" , E_USER_NOTICE) ;
return($this->properties[$property] = $value) ;
}
// =============================================================================================================================== //
/**
* Execute
*
*/
function display_exception($E)
{ $T = $E->getTrace() ;
// ======================================================================
print("MYsql error diagnostic" . "<br>\n") ;
print("================" . "<br>\n") ;
print("Message: " . $E->getMessage() . " - File: " . $E->getFile() . " - Line: " . $E->getLine() . "<br>\n") ;
print("<br>\n") ;
print("Trace: " . "<br>\n") ;
print("------ " . "<br>\n") ;
print( " => File : " . $T[0]["file"] . "<br>\n") ;
print( " => calling instruction: " . $T[0]["line"] . "<br>\n") ;
print( " => error class : " . $T[0]["class"] . "<br>\n") ;
print( " => error function : " . $T[0]["function"] . "<br>\n") ;
// ======================================================================
user_error("Catching[connect error in File: " . $T[0]["file"] . "] - line: [" . $T[0]["line"] . "]" , E_USER_ERROR) ;
// ======================================================================
}
//
// End of class: Skeleton
// ======================
}
?> |
Partager