first commit

This commit is contained in:
2026-04-24 15:32:21 +02:00
commit 20d40fead4
5046 changed files with 641038 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<?
/**
* Klasa autoryzacji usera
*
*/
class AuthDAL {
/**
* Pusty konstruktor
*
*/
public function __construct() {
}
/**
* Sprawdza uzytkownika i haslo, loguje usera , zapisuje obiekt klasy User do sesji i zwraca 1/0
*
* @param string $login
* @param string $password
* @return boolean
*/
public static function Login($login, $password) {
$dataDal = MfClientDAL::GetDalDataObj();
$dataDal->setCondition(array('login' => $login, 'password' => md5($password)));
$dataDal->addCondition('active', 1);
$user = MfClientDAL::GetResult($dataDal, false);
//Utils::ArrayDisplay($user);
if (count($user) > 0 && is_object($user[0])) {
$user[0]->setAuthorized(1);
SessionProxy::SetValue(EnumSessionValue::USER_OBJECT, $user[0]);
//Utils::ArrayDisplay(SessionProxy::GetValue(EnumSessionValue::USER_OBJECT));
return true;
} else {
return false;
}
}
/**
* Zwraca obiekt klasy User lub 0
*
* @return boolean
*/
public static function GetUser() {
$user = SessionProxy::GetValue(EnumSessionValue::USER_OBJECT);
if(is_object($user) && $user->getAuthorized()){
return $user;
} else {
return false;
}
}
/**
* Czysci sesje wylogowujac usera
*
*/
public static function Logout() {
SessionProxy::ClearValue(EnumSessionValue::USER_OBJECT);
}
}
?>

View File

@@ -0,0 +1,52 @@
<?
/**
* $Id: CacheParam.mod.php 394 2008-05-28 19:28:03Z dakl $
* Paramerty chache dla poszczegolnych elementow
*
*/
class CacheParam {
/**
* Globalny parametr uzywany wszedzie tam, gdzie nie jest zdefiniowane inaczej
*
* @var unknown_type
*/
public static $global = '30';
/**
* Cache dla strony z modelkami
*
* @var unknown_type
*/
public static $modelkiController = '10';
/**
* Cache dla bloku polecamy
*
* @var unknown_type
*/
public static $sharedRecommend = '60';
/**
* Cache dla strony glownej
*
* @var unknown_type
*/
public static $indexController = '10';
/**
* Metoda do pobierania konkretnego parametru
*
* @param string $param
* @return int
*/
public static function Get($param) {
if(isset(self::$$param)) {
return self::$$param;
}
else {
return self::$global;
}
}
}
?>