PHP Code:
<?PHP
# ------------------------------------------------------------------------------------------#
# BHLsimpleTool - PHP Content Management System #
# Copyright (c) 2008 bhl.org #
# <http://www.bhl.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 tat 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. #
# -----------------------------------------------------------------------------------------#
require("BHL_DB.php");
class BHL_UserInfoInDet extends BHL_DB{
protected $UserId;
protected $UserFname;
protected $UserFamName;
protected $UserName;
protected $UserPswd;
protected $UserVerPswd;
protected $UserEmailAdd;
protected $UserIpAdd;
public $Date;
protected $Uregcode;
public $Host;
public $Self;
public $Smail;
public $StartSession;
public $URL;
public $REFERRER;
const BHL_DB_USER_TBL = 'userregdata';
const BHL_DB_VERIFICATION = 'verification';
const BHL_CONT_MGM = 'content';
const BHL_ADMINISTRATOR = 'adminitrator';
const BhlDbBannedUsersTbl = 'banned_users';
const BhlDbCommUsersTbl = 'comments';
const BhlCatsTbl = "categories";
const BhlSubcatsTbl = "subcategories";
const BhlPermitTbl = "BhlPermissions";
protected $ArtiSub;
protected $ArtiBod;
protected $ArtiComm;
public $ScptName;
public $ScptEm;
protected $Cats;
protected $CatsDesc;
protected $Subcats;
protected $SubcatsDesc;
public function __construct($UserId, $UserFname, $UserFamName, $UserName, $UserPswd, $UserVerPswd, $UserEmailAdd, $UserIpAdd,
$Date, $Uregcode, $Host, $Self, $Smail, $Time, $URL, $REFERRER, $StartSession, $ArtiSub, $ArtiBod,
$ArtiComm, $ScptName, $ScptEm, $Cats, $CatsDesc, $Subcats, $SubcatsDesc){
parent::__construct( );
$this->UserId = $UserId;
$this->UserFname = $UserFname;
$this->UserFamName = $UserFamName;
$this->UserName = $UserName;
$this->UserPswd = $UserPswd;
$this->UserVerPswd = $UserVerPswd;
$this->UserEmailAdd = $UserEmailAdd;
$this->UserIpAdd = $UserIpAdd;
$this->BhlCurDate($Date);
$this->MdfyUserRegCode( $Uregcode );
$this->Host = $Host;
$this->Self = $Self;
$this->setmail($Smail);
$this->setTime( $Time );
$this->setSessionSt($StartSession);
$this->URL = $URL;
$this->REFERRER = $REFERRER;
$this->ArtiSub = $ArtiSub;
$this->ArtiBod = $ArtiBod;
$this->ArtiComm = $ArtiComm;
$this->setScptName($ScptName);
$this->setScptEm($ScptEm);
$this->Cats = $Cats;
$this->CatsDesc = $CatsDesc;
$this->Subcats = $Subcats;
$this->SubcatsDesc = $SubcatsDesc;
}
public function SessionSt() {
return $this->StartSession;
}
public function setSessionSt($StartSession){
$this->StartSession = session_start();
}
public function getTime() {
return $Time;
}
public function setTime( $Time ){
$this->Time = time();
}
public function getHost(){
return $this->Host;
}
public function getSelf(){
return $this->Self;
}
public function setHost( $Host ){
$this->Host = $_SERVER['HTTP_HOST'];
}
public function setSelf( $Self ){
$this->Self = $_SERVER['PHP_SELF'];
}
public function getmail(){
return $this->Smail;
}
public function setmail($Smail){
$this->Smail = 1;
}
public function CurDate(){
return $this->Date;
}
public function BhlCurDate($Date){
$this->Date = gmdate('D, d M Y H:i:s');
}
public function getScptName(){
return $this->ScptName;
}
public function setScptName($ScptName){
$this->ScptName = "BHLsimpleTOOL";
}
public function getScptEm(){
return $this->ScptEm;
}
public function setScptEm($ScptEm){
$this->ScptEm = "mail@domain.com";
}
public function ClnArtiSub(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->ArtiSub ));
}
}
public function StripArtiSub() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->ArtiSub ));
}
}
public function ClnArtiBod(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->ArtiBod ));
}
}
public function StripArtiBod() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->ArtiBod ));
}
}
public function ClnCats(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->Cats ));
}
}
public function StripCats() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->Cats ));
}
}
public function ClnCatsDesc(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->CatsDesc ));
}
}
public function StripCatsDesc() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->CatsDesc ));
}
}
public function ClnSubcats(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->Subcats ));
}
}
public function StripSubcats() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->Subcats ));
}
}
public function ClnSubcatsDesc(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->SubcatsDesc ));
}
}
public function StripSubcatsDesc() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->SubcatsDesc ));
}
}
public function ClnArtiComm(){
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->ArtiComm ));
}
}
public function StripArtiComm() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->ArtiComm ));
}
}
public function CheckIpAdd() {
if (getenv('HTTP_CLIENT_IP')) {
$this->UserIpAdd = getenv('HTTP_CLIENT_IP');
}
elseif (getenv('HTTP_X_FORWARDED_FOR')) {
$this->UserIpAdd = getenv('HTTP_X_FORWARDED_FOR');
}
elseif (getenv('HTTP_X_FORWARDED')) {
$this->UserIpAdd = getenv('HTTP_X_FORWARDED');
}
elseif (getenv('HTTP_FORWARDED_FOR')) {
$this->UserIpAdd = getenv('HTTP_FORWARDED_FOR');
}
elseif (getenv('HTTP_FORWARDED')) {
$this->UserIpAdd = getenv('HTTP_FORWARDED');
}
else {
$this->UserIpAdd = $_SERVER['REMOTE_ADDR'];
}
return $this->UserIpAdd;
}
public function ClnUserRegCode(){
if( ! get_magic_quotes_gpc() ){
return addslashes( $this->Uregcode );
}
}
public function MdfyUserRegCode( $Uregcode ){
$chars = 'abcdefghijklmnopqrstuvwxyz1234567890';
$pp = '';
while (strlen($pp) < 8) {
$pp .= substr($chars, mt_rand() % (strlen($chars)), 1);
$this->Uregcode = sha1($pp);
}
}
public function ClnUserFname() {
if( ! get_magic_quotes_gpc() ){
return addslashes(htmlspecialchars( $this->UserFname ));
}
}
public function StripUserFname() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->UserFname ));
}
}
public function ClnUserFamName() {
if( ! get_magic_quotes_gpc() ) {
return addslashes(htmlspecialchars( $this->UserFamName ));
}
}
public function StripUserFamname() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->UserFamname ));
}
}
public function ClnUserName() {
if( ! get_magic_quotes_gpc() ) {
return addslashes(htmlspecialchars( $this->UserName ));
}
}
public function StripUserName() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(htmlspecialchars( $this->UserName ));
}
}
public function ClnUserPswd(){
if( ! get_magic_quotes_gpc() ) {
return addslashes(md5(htmlspecialchars( $this->UserPswd )));
}
}
public function StripUserPswd() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(md5(htmlspecialchars( $this->UserPswd )));
}
}
public function ClnUserVerPswd() {
if( ! get_magic_quotes_gpc() ) {
return addslashes(md5(htmlspecialchars($this->UserVerPswd )));
}
}
public function StripUserVerPswd() {
if( ! get_magic_quotes_gpc() ) {
return stripslashes(sha1(htmlspecialchars( $this->UserVerPswd )));
}
}
public function ClnUserEmAdd() {
if( ! get_magic_quotes_gpc() ) {
return addslashes(htmlspecialchars( $this->UserEmailAdd ));
}
}
public function StripUserEmAdd(){
if( ! get_magic_quotes_gpc() ) {
return stripslashes( $this->UserEmailAdd );
}
}
}
?>
Bookmarks