diff --git a/src/contact.php b/src/contact.php
index d73a5aa..adaaecb 100644
--- a/src/contact.php
+++ b/src/contact.php
@@ -37,7 +37,7 @@
/** Defines
**********/
- define('PBR_VERSION','1.0.1');
+ define('PBR_VERSION','1.1.0');
define('PBR_PATH',dirname(__FILE__));
/** Include config
diff --git a/src/contactdelete.php b/src/contactdelete.php
index 369cc52..ceb5596 100644
--- a/src/contactdelete.php
+++ b/src/contactdelete.php
@@ -38,7 +38,7 @@
/** Defines
**********/
- define('PBR_VERSION','1.0.1');
+ define('PBR_VERSION','1.1.0');
define('PBR_PATH',dirname(__FILE__));
/** Include config
diff --git a/src/contactnew.php b/src/contactnew.php
index 0da1756..edf930a 100644
--- a/src/contactnew.php
+++ b/src/contactnew.php
@@ -37,7 +37,7 @@
/** Defines
**********/
- define('PBR_VERSION','1.0.1');
+ define('PBR_VERSION','1.1.0');
define('PBR_PATH',dirname(__FILE__));
/** Include config
diff --git a/src/contacts.php b/src/contacts.php
index 7f91fac..0353e89 100644
--- a/src/contacts.php
+++ b/src/contacts.php
@@ -38,7 +38,7 @@
/** Defines
**********/
- define('PBR_VERSION','1.0.1');
+ define('PBR_VERSION','1.1.0');
define('PBR_PATH',dirname(__FILE__));
/** Include config
diff --git a/src/contactsexport.php b/src/contactsexport.php
index 6f0507a..0192cec 100644
--- a/src/contactsexport.php
+++ b/src/contactsexport.php
@@ -38,7 +38,7 @@
/** Defines
**********/
- define('PBR_VERSION','1.0.1');
+ define('PBR_VERSION','1.1.0');
define('PBR_PATH',dirname(__FILE__));
/** Include config
diff --git a/src/day.php b/src/day.php
index 3440a33..d1989df 100644
--- a/src/day.php
+++ b/src/day.php
@@ -39,7 +39,7 @@
/** Defines
**********/
- define('PBR_VERSION','1.0.1');
+ define('PBR_VERSION','1.1.0');
define('PBR_PATH',dirname(__FILE__));
/** Include config
diff --git a/src/dayprint.php b/src/dayprint.php
index b4fc424..71436fd 100644
--- a/src/dayprint.php
+++ b/src/dayprint.php
@@ -38,7 +38,7 @@
/** Defines
**********/
- define('PBR_VERSION','1.0.1');
+ define('PBR_VERSION','1.1.0');
define('PBR_PATH',dirname(__FILE__));
/** Include config
diff --git a/src/includes-install/cnewuser.php b/src/includes-install/cnewuser.php
new file mode 100644
index 0000000..60ac0e4
--- /dev/null
+++ b/src/includes-install/cnewuser.php
@@ -0,0 +1,269 @@
+m_sUsername,ENT_COMPAT,'UTF-8'):$this->m_sUsername);}
+
+ /**
+ * function: SetUsername
+ * description: set username value
+ * parameter: STRING|sValue - username
+ * return: none
+ * author: Olivier JULLIEN - 2010-02-04
+ */
+ public function SetUsername( $sValue )
+ {
+ $this->m_sUsername=$this->Sanitize($sValue,GetRegExPatternName());
+ }
+
+ /**
+ * function: GetPassword
+ * description: return the password value
+ * parameter: none
+ * return: STRING
+ * author: Olivier JULLIEN - 2010-02-04
+ */
+ public function GetPassword(){return $this->m_sPassword1;}
+
+ /**
+ * function: SetPassword1
+ * description: set password1 value
+ * parameter: STRING|sValue - password
+ * return: none
+ * author: Olivier JULLIEN - 2010-02-04
+ */
+ public function SetPassword1($sValue){$this->m_sPassword1=$this->Sanitize($sValue);}
+
+ /**
+ * function: SetPassword2
+ * description: set password2 value
+ * parameter: STRING|sValue - password
+ * return: none
+ * author: Olivier JULLIEN - 2010-02-04
+ */
+ public function SetPassword2($sValue){$this->m_sPassword2=$this->Sanitize($sValue);}
+
+ /**
+ * function: IsValidNew
+ * description: return true if username and password are set
+ * parameter:
+ * return: TRUE or FALSE
+ * author: Olivier JULLIEN - 2010-02-04
+ */
+ public function IsValidNew()
+ {
+ return ( !is_null($this->m_sUsername) && (strlen($this->m_sUsername)>0)
+ && !is_null($this->m_sPassword1) && (strlen($this->m_sPassword1)>0)
+ && !is_null($this->m_sPassword2) && (strlen($this->m_sPassword2)>0)
+ && ($this->m_sPassword1===$this->m_sPassword2) );
+ }
+
+ /**
+ * function: ReadInput
+ * description: Read GET or POST input new user values
+ * parameters: INTEGER|$iFilter - Filter to apply
+ * return: BOOLEAN| TRUE or FALSE if no input value
+ * author: Olivier JULLIEN - 2010-02-04
+ */
+ public function ReadInput($iFilter)
+ {
+ $bReturn = FALSE;
+ if( $iFilter===INPUT_POST )
+ {
+ // Get user name (only POST)
+ if( filter_has_var(INPUT_POST,'usr') )
+ {
+ $this->SetUsername(filter_input(INPUT_POST,'usr',FILTER_UNSAFE_RAW));
+ }//if( filter_has_var(INPUT_POST,'usi') )
+
+ // Get Password1 (only POST)
+ if( filter_has_var(INPUT_POST,'pwd1') )
+ {
+ $sBuffer=trim(filter_input(INPUT_POST,'pwd1',FILTER_UNSAFE_RAW));
+ if( strlen($sBuffer)>0 )
+ {
+ $this->SetPassword1(sha1($sBuffer));
+ }
+ else
+ {
+ $this->m_sPassword1=NULL;
+ }//if( strlen($sBuffer)>0 )
+ }//if( filter_has_var(INPUT_POST,'pwd1') )
+
+ // Get Password2 (only POST)
+ if( filter_has_var(INPUT_POST,'pwd2') )
+ {
+ $sBuffer=trim(filter_input(INPUT_POST,'pwd2',FILTER_UNSAFE_RAW));
+ if( strlen($sBuffer)>0 )
+ {
+ $this->SetPassword2(sha1($sBuffer));
+ }
+ else
+ {
+ $this->m_sPassword2=NULL;
+ }//if( strlen($sBuffer)>0 )
+ }//if( filter_has_var(INPUT_POST,'pwd2') )
+
+ $bReturn = TRUE;
+
+ }//if( $iFilter===INPUT_POST )
+
+ return $bReturn;
+ }
+
+}
+define('PBR_NEWUSER_LOADED',1);
+?>
diff --git a/src/includes-install/database/data-config.sql b/src/includes-install/database/data-config.sql
index 115c1b8..ad07972 100644
--- a/src/includes-install/database/data-config.sql
+++ b/src/includes-install/database/data-config.sql
@@ -35,7 +35,7 @@ SET AUTOCOMMIT=0;
INSERT INTO `config` (`name`,`value`,`role`) VALUES
('data_version','1.0 - 2010-02-04',10),
('cookie_time_expire','36000',10),
-('session_time_expire','7200',10),
+('session_time_expire','36000',10),
('timezone','+1:00',10),
('max_rent_1','300',10),
('max_rent_2','300',10),
diff --git a/src/includes-install/database/sp_configget.sql b/src/includes-install/database/sp_configget.sql
deleted file mode 100644
index f1b52ca..0000000
--- a/src/includes-install/database/sp_configget.sql
+++ /dev/null
@@ -1,140 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ConfigGet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Returns autoload config values. *
- * ASSUME: The columns of the tables are case insentive. *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * sName: name. May be empty or NULL. *
- * *
- * Returns: *
- * none or one record (config_name, config_value) *
- * or *
- * ErrorCode: -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ConfigGet` $$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ConfigGet`( IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN sName VARCHAR(45) )
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle VARCHAR(255) DEFAULT ' IN sp_ConfigGet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(sName,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- SET sName=TRIM(sName);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Session is valid --
- SET sErrorDescription = 'Select';
- IF( (sName IS NOT NULL) AND (LENGTH(sName)>0) ) THEN
- BEGIN
- -- Looking for an unique config value --
- SELECT c.`name` AS 'config_name', c.`value` AS 'config_value' FROM `_PBR_DB_DBN_`.`config` AS c
- INNER JOIN `_PBR_DB_DBN_`.`user` AS u ON c.`role` <= u.`role` AND u.`state` = 1
- WHERE u.`login` = sLogin AND c.`name`=sName;
- END;
- ELSE
- BEGIN
- -- Looking for a list of config value --
- SELECT c.`name` AS 'config_name', c.`value` AS 'config_value' FROM `_PBR_DB_DBN_`.`config` AS c
- INNER JOIN `_PBR_DB_DBN_`.`user` AS u ON c.`role` <= u.`role` AND u.`state` = 1
- WHERE u.`login` = sLogin ORDER BY c.`name` ASC;
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- SELECT -2 AS 'ErrorCode';
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- SELECT -1 AS 'ErrorCode';
- END;
- END IF;
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_configupdate.sql b/src/includes-install/database/sp_configupdate.sql
deleted file mode 100644
index 6e39e4e..0000000
--- a/src/includes-install/database/sp_configupdate.sql
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 JOT - PBRAIDERS.COM *
- * Tous droits rservs - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ConfigUpdate *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Update a config value. *
- * COPYRIGHT : JOT, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * sName: parameter's name. *
- * sValue: parameter's value. *
- * *
- * Returns: *
- * ErrorCode: >0 is OK. Number of row inserted. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ConfigUpdate`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ConfigUpdate`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN sName VARCHAR(45), IN sValue VARCHAR(255))
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode INTEGER DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ConfigUpdate';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(sName,'NULL'),',',IFNULL(sValue,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- SET sName = TRIM(sName);
- SET sValue = TRIM(sValue);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (sName IS NOT NULL) AND (LENGTH(sName)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 10, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Update --
- SET sErrorDescription = 'Update';
- UPDATE `_PBR_DB_DBN_`.`config` SET `value`=sValue WHERE `name`=sName;
- SELECT ROW_COUNT() INTO iErrorCode;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_contactdel.sql b/src/includes-install/database/sp_contactdel.sql
deleted file mode 100644
index dfb7bae..0000000
--- a/src/includes-install/database/sp_contactdel.sql
+++ /dev/null
@@ -1,167 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ContactDel *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Delete a contact *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iContact: contact identifier *
- * *
- * Returns: *
- * ErrorCode: >0 is OK. Number of row deleted. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ContactDel`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ContactDel`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iContact MEDIUMINT UNSIGNED )
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode TINYINT(1) DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ContactDel';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE bInTransaction TINYINT(1) DEFAULT 0;
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- IF 1=bInTransaction THEN
- ROLLBACK;
- END IF;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- IF 1=bInTransaction THEN
- ROLLBACK;
- END IF;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- IF 1=bInTransaction THEN
- ROLLBACK;
- END IF;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An SQLEXCEPTION occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SET iErrorCode = -1;
- SELECT iErrorCode AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iContact,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iContact IS NOT NULL) AND (iContact>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Start transaction --
- SET sErrorDescription = 'Start transaction';
- START TRANSACTION;
- SET bInTransaction = 1;
- -- Delete rents --
- SET sErrorDescription = 'Delete rents';
- DELETE FROM `_PBR_DB_DBN_`.`reservation` WHERE `idcontact`=iContact;
- -- Delete rents --
- SET sErrorDescription = 'Delete rents';
- DELETE FROM `_PBR_DB_DBN_`.`contact` WHERE `idcontact`=iContact;
- SELECT ROW_COUNT() INTO iErrorCode;
- -- Stop transaction --
- IF iErrorCode>0 THEN
- BEGIN
- -- No error --
- SET sErrorDescription = 'COMMIT transaction';
- COMMIT;
- END;
- ELSE
- BEGIN
- -- Error --
- SET sErrorDescription = 'ROLLBACK transaction';
- ROLLBACK;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('TRANSACTION',sErrorTitle), CONCAT('An error occures while processing "','deleting contact and rent','" step. Exit'),USER(),CURRENT_USER() );
- END;
- END IF;
- SET bInTransaction = 0;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_contactget.sql b/src/includes-install/database/sp_contactget.sql
deleted file mode 100644
index 09a6ddb..0000000
--- a/src/includes-install/database/sp_contactget.sql
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ContactGet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get contact *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iContact: contact identifier *
- * *
- * Returns: *
- * none or one record (contact_id,contact_lastname, *
- * contact_firstname,contact_tel,contact_email,contact_address *
- * contact_addressmore,contact_addresscity,contact_addresszip *
- * contact_comment,creation_date,creation_username,update_date *
- * update_username) *
- * or *
- * ErrorCode: -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ContactGet`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ContactGet`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iContact MEDIUMINT UNSIGNED )
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ContactGet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iContact,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (iContact IS NOT NULL) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Select --
- SET sErrorDescription = 'request';
- SELECT c.`idcontact` AS 'contact_id',c.`lastname` AS 'contact_lastname'
- ,c.`firstname` AS 'contact_firstname',c.`tel` AS 'contact_tel'
- ,c.`email` AS 'contact_email',c.`address` AS 'contact_address'
- ,c.`address_more` AS 'contact_addressmore',c.`city` AS 'contact_addresscity'
- ,c.`zip` AS 'contact_addresszip',c.`comment` AS 'contact_comment'
- ,c.`create_date` AS 'creation_date',u.`login` AS 'creation_username'
- ,c.`update_date` AS 'update_date',v.`login` AS 'update_username'
- FROM `_PBR_DB_DBN_`.`contact` AS c
- INNER JOIN `_PBR_DB_DBN_`.`user` AS u ON c.`create_iduser`=u.`iduser`
- LEFT JOIN `_PBR_DB_DBN_`.`user` AS v ON c.`update_iduser`=v.`iduser`
- WHERE c.`idcontact` = iContact;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- SELECT -2 AS 'ErrorCode';
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- SELECT -1 AS 'ErrorCode';
- END;
- END IF;
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_contactrentsget.sql b/src/includes-install/database/sp_contactrentsget.sql
deleted file mode 100644
index 781c365..0000000
--- a/src/includes-install/database/sp_contactrentsget.sql
+++ /dev/null
@@ -1,161 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ContactRentsGet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get rent(s) contact *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iContact: contact identifier *
- * iOffset: offset of the first row to return *
- * iLimit: maximum number of rows to return *
- * *
- * NOTE: In MYSQL 5.x the LIMIT clause do not accept variables. *
- * So we use a less performant request to simulate it. *
- * This procedure should be updated for MYSQL > 6.0. *
- * *
- * Returns: *
- * none or one record (reservation_id, reservation_year, *
- * reservation_month, reservation_day, reservation_real, *
- * reservation_planned, reservation_canceled, reservation_arrhes,*
- * reservation_age, reservation_comment, reservation_max) *
- * or *
- * ErrorCode: -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ContactRentsGet`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ContactRentsGet`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iContact MEDIUMINT UNSIGNED, IN iOffset MEDIUMINT UNSIGNED, IN iLimit MEDIUMINT UNSIGNED )
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ContactRentsGet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iContact,'NULL'),',',IFNULL(iOffset,'NULL'),',',IFNULL(iLimit,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iContact IS NOT NULL) AND (iContact>0) AND (iOffset IS NOT NULL) AND (LENGTH(iOffset)>=0) AND (iLimit IS NOT NULL) AND (LENGTH(iLimit)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Select --
- SET @iRowNum:=0;
- SET sErrorDescription = 'Select';
- SELECT t.`reservation_id`
- , t.`reservation_year`
- , t.`reservation_month`
- , t.`reservation_day`
- , t.`reservation_real`
- , t.`reservation_planned`
- , t.`reservation_canceled`
- , t.`reservation_age`
- , t.`reservation_arrhes`
- , t.`reservation_comment`
- , t.`reservation_max`
- FROM ( SELECT (@iRowNum:=@iRowNum+1) AS RowNumber
- , r.`idreservation` AS 'reservation_id'
- , r.`year` AS 'reservation_year'
- , r.`month` AS 'reservation_month'
- , r.`day` AS 'reservation_day'
- , r.`rent_real` AS 'reservation_real'
- , r.`rent_planned` AS 'reservation_planned'
- , r.`rent_canceled` AS 'reservation_canceled'
- , r.`age` AS 'reservation_age'
- , r.`arrhe` AS 'reservation_arrhes'
- , r.`comment` AS 'reservation_comment'
- , r.`rent_max` AS 'reservation_max'
- FROM `_PBR_DB_DBN_`.`reservation` AS r
- WHERE r.`idcontact`=iContact
- ORDER BY r.`year` DESC, r.`month` DESC, r.`day` DESC) AS t
- WHERE t.RowNumber > iOffset
- AND t.RowNumber <= (iOffset + iLimit);
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- SELECT -2 AS 'ErrorCode';
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- SELECT -1 AS 'ErrorCode';
- END;
- END IF;
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_contactrentsgetcount.sql b/src/includes-install/database/sp_contactrentsgetcount.sql
deleted file mode 100644
index 9e1b02d..0000000
--- a/src/includes-install/database/sp_contactrentsgetcount.sql
+++ /dev/null
@@ -1,129 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ContactRentsGetCount *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get rent count for a contact *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iContact: contact identifier *
- * *
- * Returns: *
- * ErrorCode: >=0 is OK. Number of row. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ContactRentsGetCount`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ContactRentsGetCount`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iContact MEDIUMINT UNSIGNED)
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode INTEGER DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ContactRentsGetCount';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iContact,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iContact IS NOT NULL) AND (iContact>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Select --
- SET sErrorDescription = 'Select';
- SELECT COUNT(r.`idreservation`) INTO iErrorCode
- FROM `_PBR_DB_DBN_`.`reservation` AS r
- WHERE r.`idcontact`=iContact;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_contactset.sql b/src/includes-install/database/sp_contactset.sql
deleted file mode 100644
index 98ddc7c..0000000
--- a/src/includes-install/database/sp_contactset.sql
+++ /dev/null
@@ -1,146 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ContactSet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Create a contact *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * sLastName: contact last name *
- * sFirstName: contact first name *
- * sTel: contact telephone *
- * sEmail: contact email *
- * sAddress: contact address *
- * sAddressMore: contact address more *
- * sCity: contact address city *
- * sZip: contact address zip code *
- * sComment: comment *
- * *
- * Returns: *
- * ErrorCode: >0 is OK. Number of row inserted. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ContactSet`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ContactSet`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN sLastName VARCHAR(40), IN sFirstName VARCHAR(40), IN sTel VARCHAR(40), IN sEmail VARCHAR(255), IN sAddress VARCHAR(255), IN sAddressMore VARCHAR(255), IN sCity VARCHAR(255), IN sZip VARCHAR(8), IN sComment TEXT)
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode INT(1) DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ContactSet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(sLastName,'NULL'),',',IFNULL(sFirstName,'NULL'),',',IFNULL(sTel,'NULL'),',...)');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- SET sLastName=TRIM(sLastName);
- SET sFirstName=TRIM(sFirstName);
- SET sTel=TRIM(sTel);
- SET sEmail=TRIM(sEmail);
- SET sAddress=TRIM(sAddress);
- SET sAddressMore=TRIM(sAddressMore);
- SET sCity=TRIM(sCity);
- SET sZip=TRIM(sZip);
- SET sComment=TRIM(sComment);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (sLastName IS NOT NULL) AND (LENGTH(sLastName)>0) AND (sFirstName IS NOT NULL) AND (LENGTH(sFirstName)>0) AND (sTel IS NOT NULL) AND (LENGTH(sTel)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Insert --
- SET sErrorDescription = 'Insert';
- INSERT INTO `_PBR_DB_DBN_`.`contact`(`lastname`, `firstname`, `tel`, `email`, `address`, `address_more`, `city`, `zip`, `comment`, `create_date`, `create_iduser`, `update_date`, `update_iduser`)
- VALUES (sLastName, sFirstName, sTel, sEmail, sAddress, sAddressMore, sCity, sZip, sComment, SYSDATE(), iUser, NULL, NULL);
- SELECT LAST_INSERT_ID() INTO iErrorCode;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_contactsget.sql b/src/includes-install/database/sp_contactsget.sql
deleted file mode 100644
index b734c54..0000000
--- a/src/includes-install/database/sp_contactsget.sql
+++ /dev/null
@@ -1,187 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ContactsGet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get contact(s) *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * sSearch: contact last name *
- * iOffset: offset of the first row to return *
- * iLimit: maximum number of rows to return *
- * *
- * NOTE: In MYSQL 5.x the LIMIT clause do not accept variables. *
- * So we use a less performant request to simulate it. *
- * This procedure should be updated for MYSQL > 6.0. *
- * *
- * Returns: *
- * none, one or more records (contact_id,contact_lastname, *
- * contact_firstname,contact_tel,contact_email,contact_address *
- * contact_addressmore,contact_addresscity,contact_addresszip *
- * contact_comment,creation_date,creation_username,update_date *
- * update_username) *
- * or *
- * ErrorCode: -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ContactsGet`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ContactsGet`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN sSearch VARCHAR(40), IN iOffset MEDIUMINT UNSIGNED, IN iLimit MEDIUMINT UNSIGNED)
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ContactsGet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(sSearch,'NULL'),',',IFNULL(iOffset,'NULL'),',',IFNULL(iLimit,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- SET sSearch=TRIM(sSearch);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iOffset IS NOT NULL) AND (LENGTH(iOffset)>=0) AND (iLimit IS NOT NULL) AND (LENGTH(iLimit)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- SET @iRowNum:=0;
- IF (sSearch IS NOT NULL) AND (LENGTH(sSearch)>0) THEN
- BEGIN
- -- Looking for --
- SET sErrorDescription = 'Looking for';
- SELECT t.`contact_id`,t.`contact_lastname`
- ,t.`contact_firstname`,t.`contact_tel`
- ,t.`contact_email`,t.`contact_address`
- ,t.`contact_addressmore`,t.`contact_addresscity`
- ,t.`contact_addresszip`,t.`contact_comment`
- ,t.`creation_date`,t.`creation_username`
- ,t.`update_date`,t.`update_username`
- FROM ( SELECT (@iRowNum:=@iRowNum+1) AS RowNumber
- ,c.`idcontact` AS 'contact_id',c.`lastname` AS 'contact_lastname'
- ,c.`firstname` AS 'contact_firstname',c.`tel` AS 'contact_tel'
- ,c.`email` AS 'contact_email',c.`address` AS 'contact_address'
- ,c.`address_more` AS 'contact_addressmore',c.`city` AS 'contact_addresscity'
- ,c.`zip` AS 'contact_addresszip',c.`comment` AS 'contact_comment'
- ,c.`create_date` AS 'creation_date',u.`login` AS 'creation_username'
- ,c.`update_date` AS 'update_date',v.`login` AS 'update_username'
- FROM `_PBR_DB_DBN_`.`contact` AS c
- INNER JOIN `_PBR_DB_DBN_`.`user` AS u ON c.`create_iduser`=u.`iduser`
- LEFT JOIN `_PBR_DB_DBN_`.`user` AS v ON c.`update_iduser`=v.`iduser`
- WHERE c.`lastname` LIKE sSearch
- ORDER BY c.`lastname`) AS t
- WHERE t.RowNumber > iOffset
- AND t.RowNumber <= (iOffset + iLimit);
- END;
- ELSE
- BEGIN
- -- Select --
- SET sErrorDescription = 'Select';
- SELECT t.`contact_id`,t.`contact_lastname`
- ,t.`contact_firstname`,t.`contact_tel`
- ,t.`contact_email`,t.`contact_address`
- ,t.`contact_addressmore`,t.`contact_addresscity`
- ,t.`contact_addresszip`,t.`contact_comment`
- ,t.`creation_date`,t.`creation_username`
- ,t.`update_date`,t.`update_username`
- FROM ( SELECT (@iRowNum:=@iRowNum+1) AS RowNumber
- ,c.`idcontact` AS 'contact_id',c.`lastname` AS 'contact_lastname'
- ,c.`firstname` AS 'contact_firstname',c.`tel` AS 'contact_tel'
- ,c.`email` AS 'contact_email',c.`address` AS 'contact_address'
- ,c.`address_more` AS 'contact_addressmore',c.`city` AS 'contact_addresscity'
- ,c.`zip` AS 'contact_addresszip',c.`comment` AS 'contact_comment'
- ,c.`create_date` AS 'creation_date',u.`login` AS 'creation_username'
- ,c.`update_date` AS 'update_date',v.`login` AS 'update_username'
- FROM `_PBR_DB_DBN_`.`contact` AS c
- INNER JOIN `_PBR_DB_DBN_`.`user` AS u ON c.`create_iduser`=u.`iduser`
- LEFT JOIN `_PBR_DB_DBN_`.`user` AS v ON c.`update_iduser`=v.`iduser`
- ORDER BY c.`lastname`) AS t
- WHERE t.RowNumber > iOffset
- AND t.RowNumber <= (iOffset + iLimit);
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- SELECT -2 AS 'ErrorCode';
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- SELECT -1 AS 'ErrorCode';
- END;
- END IF;
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_contactsgetcount.sql b/src/includes-install/database/sp_contactsgetcount.sql
deleted file mode 100644
index b62d5d2..0000000
--- a/src/includes-install/database/sp_contactsgetcount.sql
+++ /dev/null
@@ -1,138 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ContactsGetCount *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get contacts count. *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * sSearch: contact last name *
- * *
- * Returns: *
- * ErrorCode: >=0 is OK. Number of row. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ContactsGetCount`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ContactsGetCount`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN sSearch VARCHAR(40) )
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode INTEGER DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ContactsGetCount';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(sSearch,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- SET sSearch=TRIM(sSearch);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- IF (sSearch IS NOT NULL) AND (LENGTH(sSearch)>0) THEN
- BEGIN
- -- Looking for --
- SET sErrorDescription = 'Looking for';
- SELECT COUNT(c.`idcontact`) INTO iErrorCode FROM `_PBR_DB_DBN_`.`contact` AS c WHERE c.`lastname` LIKE sSearch;
- END;
- ELSE
- BEGIN
- -- Select --
- SET sErrorDescription = 'Select';
- SELECT COUNT(c.`idcontact`) INTO iErrorCode FROM `_PBR_DB_DBN_`.`contact` AS c;
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_contactupdate.sql b/src/includes-install/database/sp_contactupdate.sql
deleted file mode 100644
index 478e9be..0000000
--- a/src/includes-install/database/sp_contactupdate.sql
+++ /dev/null
@@ -1,148 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ContactUpdate *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Create a contact *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iIdentifier: contact identifier *
- * sLastName: contact last name *
- * sFirstName: contact first name *
- * sTel: contact telephone *
- * sEmail: contact email *
- * sAddress: contact address *
- * sAddressMore: contact address more *
- * sCity: contact address city *
- * sZip: contact address zip code *
- * sComment: comment *
- * *
- * Returns: *
- * ErrorCode: >0 is OK. Number of row updated. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ContactUpdate`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ContactUpdate`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iContact MEDIUMINT UNSIGNED, IN sLastName VARCHAR(40), IN sFirstName VARCHAR(40), IN sTel VARCHAR(40), IN sEmail VARCHAR(255), IN sAddress VARCHAR(255), IN sAddressMore VARCHAR(255), IN sCity VARCHAR(255), IN sZip VARCHAR(8), IN sComment TEXT)
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode TINYINT(1) DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_ContactUpdate';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iContact,'NULL'),',',IFNULL(sLastName,'NULL'),',',IFNULL(sFirstName,'NULL'),',',IFNULL(sTel,'NULL'),',...)');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- SET sLastName=TRIM(sLastName);
- SET sFirstName=TRIM(sFirstName);
- SET sTel=TRIM(sTel);
- SET sEmail=TRIM(sEmail);
- SET sAddress=TRIM(sAddress);
- SET sAddressMore=TRIM(sAddressMore);
- SET sCity=TRIM(sCity);
- SET sZip=TRIM(sZip);
- SET sComment=TRIM(sComment);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iContact IS NOT NULL) AND (iContact>0) AND (sLastName IS NOT NULL) AND (LENGTH(sLastName)>0) AND (sFirstName IS NOT NULL) AND (LENGTH(sFirstName)>0) AND (sTel IS NOT NULL) AND (LENGTH(sTel)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Update --
- SET sErrorDescription = 'Update';
- UPDATE `_PBR_DB_DBN_`.`contact` SET `lastname`=sLastName, `firstname`=sFirstName, `tel`=sTel, `email`=sEmail,
- `address`=sAddress, `address_more`=sAddressMore, `city`=sCity, `zip`=sZip, `comment`=sComment, `update_date`=SYSDATE(), `update_iduser`=iUser
- WHERE `idcontact`=iContact;
- SELECT ROW_COUNT() INTO iErrorCode;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_logsdel.sql b/src/includes-install/database/sp_logsdel.sql
deleted file mode 100644
index 990a822..0000000
--- a/src/includes-install/database/sp_logsdel.sql
+++ /dev/null
@@ -1,127 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_LogsDel *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Delete logs *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * *
- * Returns: *
- * ErrorCode: >0 is OK. Number of row deleted. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_LogsDel`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_LogsDel`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255))
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode TINYINT(1) DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_LogsDel';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 10, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Delete --
- SET sErrorDescription = 'Delete';
- DELETE FROM `_PBR_DB_DBN_`.`log`;
- SELECT ROW_COUNT() INTO iErrorCode;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_logsget.sql b/src/includes-install/database/sp_logsget.sql
deleted file mode 100644
index 5d3fbf5..0000000
--- a/src/includes-install/database/sp_logsget.sql
+++ /dev/null
@@ -1,150 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_LogsGet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get log(s) *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iOffset: offset of the first row to return *
- * iLimit: maximum number of rows to return *
- * *
- * NOTE: In MYSQL 5.x the LIMIT clause do not accept variables. *
- * So we use a less performant request to simulate it. *
- * This procedure should be updated for MYSQL > 6.0. *
- * *
- * Returns: *
- * none, one or more records (log_date, log_user, log_type, *
- * log_title, log_description, log_mysqluser, *
- * log_mysqlcurrentuser) *
- * or *
- * ErrorCode: -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_LogsGet`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_LogsGet`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iOffset MEDIUMINT UNSIGNED, IN iLimit MEDIUMINT UNSIGNED)
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_LogsGet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iOffset,'NULL'),',',IFNULL(iLimit,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iOffset IS NOT NULL) AND (LENGTH(iOffset)>=0) AND (iLimit IS NOT NULL) AND (LENGTH(iLimit)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 10, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- SET @iRowNum:=0;
- -- Select --
- SET sErrorDescription = 'Select';
- SELECT t.`logged` AS "log_date"
- ,t.`username` AS "log_user"
- ,t.`type` AS "log_type"
- ,t.`title` AS "log_title"
- ,t.`description` AS "log_description"
- ,t.`mysqluser` AS "log_mysqluser"
- ,t.`mysqlcurrentuser` AS "log_mysqlcurrentuser"
- FROM ( SELECT (@iRowNum:=@iRowNum+1) AS RowNumber
- ,l.`logged`
- ,l.`username`
- ,l.`type`
- ,l.`title`
- ,l.`description`
- ,l.`mysqluser`
- ,l.`mysqlcurrentuser`
- FROM `log` l
- ORDER BY l.`logged` DESC) AS t
- WHERE t.RowNumber > iOffset
- AND t.RowNumber <= (iOffset + iLimit);
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- SELECT -2 AS 'ErrorCode';
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- SELECT -1 AS 'ErrorCode';
- END;
- END IF;
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_logsgetcount.sql b/src/includes-install/database/sp_logsgetcount.sql
deleted file mode 100644
index bed9167..0000000
--- a/src/includes-install/database/sp_logsgetcount.sql
+++ /dev/null
@@ -1,126 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_LogsGetCount *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get logs count. *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * *
- * Returns: *
- * ErrorCode: >=0 is OK. Number of row. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_LogsGetCount`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_LogsGetCount`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255))
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode INTEGER DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_LogsGetCount';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 10, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Select --
- SET sErrorDescription = 'Select';
- SELECT COUNT(l.`idlog`) INTO iErrorCode FROM `_PBR_DB_DBN_`.`log` AS l;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_maxget.sql b/src/includes-install/database/sp_maxget.sql
deleted file mode 100644
index 69b0bb0..0000000
--- a/src/includes-install/database/sp_maxget.sql
+++ /dev/null
@@ -1,123 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_MaxGet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get rent max per month *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * *
- * Returns: *
- * none, one or more records (month, max) *
- * or *
- * ErrorCode: -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_MaxGet`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_MaxGet`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255))
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_MaxGet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 10, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Select --
- SET sErrorDescription = 'Select';
- SELECT c.`name` AS "month", c.`value` AS "max" FROM `_PBR_DB_DBN_`.`config` AS c WHERE c.`name` LIKE 'max_rent_%';
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- SELECT -2 AS 'ErrorCode';
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- SELECT -1 AS 'ErrorCode';
- END;
- END IF;
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_parameterget.sql b/src/includes-install/database/sp_parameterget.sql
deleted file mode 100644
index 47ce238..0000000
--- a/src/includes-install/database/sp_parameterget.sql
+++ /dev/null
@@ -1,59 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2009 JOT - PBRAIDERS.COM *
- * Tous droits rservs - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_ParameterGet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Return the max size group *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sMonth: rent month *
- * *
- * OUT iMax: max of the month *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_ParameterGet` $$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_ParameterGet`(IN sMonth VARCHAR(2), OUT iMax INTEGER)
-BEGIN
- SELECT IFNULL(c.`value`,0) INTO iMax
- FROM `_PBR_DB_DBN_`.`config` AS c
- WHERE c.`name` LIKE CONCAT_WS('_','max_rent',sMonth);
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_rentcontactset.sql b/src/includes-install/database/sp_rentcontactset.sql
deleted file mode 100644
index 425d7d8..0000000
--- a/src/includes-install/database/sp_rentcontactset.sql
+++ /dev/null
@@ -1,213 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_RentContactSet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Create a contact and a rent *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * sLastName: contact last name *
- * sFirstName: contact first name *
- * sTel: contact telephone *
- * sEmail: contact email *
- * sAddress: contact address *
- * sAddressMore: contact address more *
- * sCity: contact address city *
- * sZip: contact address zip code *
- * iReal: group real count *
- * iPlanned: group planned count *
- * iCanceled: group canceled count *
- * iAge: group age *
- * iArrhes: rent arrhes *
- * iDay: rent day *
- * iMonth: rent month *
- * iYear: rent year *
- * *
- * Returns: *
- * ErrorCode: >0 is OK. Number of row inserted. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_RentContactSet`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_RentContactSet`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN sLastName VARCHAR(40), IN sFirstName VARCHAR(40), IN sTel VARCHAR(40), IN sEmail VARCHAR(255), IN sAddress VARCHAR(255), IN sAddressMore VARCHAR(255), IN sCity VARCHAR(255), IN sZip VARCHAR(8), IN iReal SMALLINT UNSIGNED,IN iPlanned SMALLINT UNSIGNED,IN iCanceled SMALLINT UNSIGNED,IN iAge TINYINT UNSIGNED,IN iArrhes TINYINT UNSIGNED,IN iDay TINYINT UNSIGNED, IN iMonth TINYINT UNSIGNED,IN iYear SMALLINT UNSIGNED)
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode INTEGER DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_RentContactSet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- DECLARE iContact MEDIUMINT UNSIGNED DEFAULT 0;
- DECLARE bInTransaction TINYINT(1) DEFAULT 0;
- DECLARE iMaxRent INTEGER UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- IF 1=bInTransaction THEN
- ROLLBACK;
- END IF;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- IF 1=bInTransaction THEN
- ROLLBACK;
- END IF;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- IF 1=bInTransaction THEN
- ROLLBACK;
- END IF;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An SQLEXCEPTION occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SET iErrorCode = -1;
- SELECT iErrorCode AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(sLastName,'NULL'),',',IFNULL(sFirstName,'NULL'),',',IFNULL(sTel,'NULL'),',',IFNULL(iDay,'NULL'),',',IFNULL(iMonth,'NULL'),',',IFNULL(iYear,'NULL'),',...)');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- SET sLastName=TRIM(sLastName);
- SET sFirstName=TRIM(sFirstName);
- SET sTel=TRIM(sTel);
- SET sEmail=TRIM(sEmail);
- SET sAddress=TRIM(sAddress);
- SET sAddressMore=TRIM(sAddressMore);
- SET sCity=TRIM(sCity);
- SET sZip=TRIM(sZip);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (sLastName IS NOT NULL) AND (LENGTH(sLastName)>0) AND (sFirstName IS NOT NULL) AND (LENGTH(sFirstName)>0) AND (sTel IS NOT NULL) AND (LENGTH(sTel)>0) AND (iReal IS NOT NULL) AND (iPlanned IS NOT NULL) AND (iCanceled IS NOT NULL) AND (iDay IS NOT NULL) AND (iDay>0) AND (iDay<32) AND (iMonth IS NOT NULL) AND (iMonth>0) AND (iMonth<13) AND (iYear IS NOT NULL) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Select default max rent --
- SET sErrorDescription = 'Select max rent';
- SELECT IFNULL(MAX(r.`rent_max`),0) INTO iMaxRent
- FROM `_PBR_DB_DBN_`.`reservation` AS r
- WHERE r.`year`=iYear
- AND r.`month`=iMonth
- AND r.`day`=iDay;
- IF iMaxRent<=0 THEN
- BEGIN
- -- Select default max rent --
- SET sErrorDescription = 'Select default max rent';
- CALL sp_ParameterGet(iMonth,iMaxRent);
- END;
- END IF;
- -- Start transaction --
- SET sErrorDescription = 'Start transaction';
- START TRANSACTION;
- SET bInTransaction = 1;
- -- Insert Contact --
- SET sErrorDescription = 'Insert contact';
- INSERT INTO `_PBR_DB_DBN_`.`contact`(`lastname`, `firstname`, `tel`, `email`, `address`, `address_more`, `city`, `zip`, `create_date`, `create_iduser`, `update_date`, `update_iduser`)
- VALUES (sLastName, sFirstName, sTel, sEmail, sAddress, sAddressMore, sCity, sZip, SYSDATE(), iUser, NULL, NULL);
- SELECT LAST_INSERT_ID() INTO iContact;
- -- Insert Rent --
- IF iContact>0 THEN
- BEGIN
- SET sErrorDescription = 'Insert rent';
- INSERT INTO `_PBR_DB_DBN_`.`reservation` (`idcontact`,`year`,`month`,`day`,`rent_real`,`rent_planned`,`rent_canceled`,`rent_max`,`age`,`arrhe`,`create_date`,`create_iduser`,`update_date`,`update_iduser`)
- VALUES (iContact, iYear, iMonth, iDay, iReal, iPlanned, iCanceled, iMaxRent, iAge, iArrhes, SYSDATE(), iUser, NULL, NULL);
- SELECT LAST_INSERT_ID() INTO iErrorCode;
- END;
- END IF;
- -- Stop transaction --
- IF iErrorCode>0 THEN
- BEGIN
- -- No error --
- SET sErrorDescription = 'COMMIT transaction';
- COMMIT;
- END;
- ELSE
- BEGIN
- -- Error --
- SET sErrorDescription = 'ROLLBACK transaction';
- ROLLBACK;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('TRANSACTION',sErrorTitle), CONCAT('An error occures while processing "','adding contact and rent','" step. Exit'),USER(),CURRENT_USER() );
- END;
- END IF;
- SET bInTransaction = 0;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_rentdel.sql b/src/includes-install/database/sp_rentdel.sql
deleted file mode 100644
index bfd735c..0000000
--- a/src/includes-install/database/sp_rentdel.sql
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_RentDel *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Delete a rent *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iRent: rent identifier *
- * *
- * Returns: *
- * ErrorCode: >0 is OK. Number of row deleted. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_RentDel`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_RentDel`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iRent MEDIUMINT UNSIGNED )
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode TINYINT(1) DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_RentDel';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iRent,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iRent IS NOT NULL) AND (iRent>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Delete --
- SET sErrorDescription = 'Delete';
- DELETE FROM `_PBR_DB_DBN_`.`reservation` WHERE `idreservation`=iRent;
- SELECT ROW_COUNT() INTO iErrorCode;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- SET iErrorCode=-2;
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- END;
- END IF;
- -- ------ --
- -- Return --
- -- ------ --
- SELECT iErrorCode AS 'ErrorCode';
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_rentget.sql b/src/includes-install/database/sp_rentget.sql
deleted file mode 100644
index a0e61a0..0000000
--- a/src/includes-install/database/sp_rentget.sql
+++ /dev/null
@@ -1,160 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_RentGet *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Get a rent *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iRent: rent identifier *
- * *
- * Returns: *
- * none or one record (reservation_year, reservation_month, *
- * reservation_day, reservation_real, reservation_planned, *
- * reservation_canceled, reservation_max, reservation_age, *
- * reservation_arrhes, reservation_comment, creation_date, *
- * creation_username, update_date, update_username, *
- * contact_lastname, contact_firstname, contact_tel, *
- * contact_email,contact_address, contact_addressmore, *
- * contact_addresscity, contact_addresszip, contact_id, *
- * reservation_id) *
- * or *
- * ErrorCode: -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_RentGet`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_RentGet`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iRent MEDIUMINT UNSIGNED )
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_RentGet';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iRent,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iRent IS NOT NULL) AND (iRent>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 1, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Select --
- SET sErrorDescription = 'Request';
- SELECT r.`idreservation` AS 'reservation_id'
- , r.`year` AS 'reservation_year'
- , r.`month` AS 'reservation_month'
- , r.`day` AS 'reservation_day'
- , r.`rent_real` AS 'reservation_real'
- , r.`rent_planned` AS 'reservation_planned'
- , r.`rent_canceled` AS 'reservation_canceled'
- , r.`rent_max` AS 'reservation_max'
- , r.`age` AS 'reservation_age'
- , r.`arrhe` AS 'reservation_arrhes'
- , r.`comment` AS 'reservation_comment'
- , r.`create_date` AS 'creation_date'
- , u.`login` AS 'creation_username'
- , r.`update_date` AS 'update_date'
- , v.`login` AS 'update_username'
- , c.`lastname` AS 'contact_lastname'
- , c.`firstname` AS 'contact_firstname'
- , c.`tel` AS 'contact_tel'
- , c.`email` AS 'contact_email'
- , c.`address` AS 'contact_address'
- , c.`address_more` AS 'contact_addressmore'
- , c.`city` AS 'contact_addresscity'
- , c.`zip` AS 'contact_addresszip'
- , c.`idcontact` AS 'contact_id'
- FROM `_PBR_DB_DBN_`.`reservation` AS r
- INNER JOIN `_PBR_DB_DBN_`.`contact` AS c ON r.`idcontact`=c.`idcontact`
- INNER JOIN `_PBR_DB_DBN_`.`user` AS u ON r.`create_iduser`=u.`iduser`
- LEFT JOIN `_PBR_DB_DBN_`.`user` AS v ON r.`update_iduser`=v.`iduser`
- WHERE r.`idreservation`=iRent;
- END;
- ELSE
- BEGIN
- -- User, session and/or inet is/are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'WARNING', CONCAT('SESSION CHECK',sErrorTitle), 'Not allowed.',USER(),CURRENT_USER() );
- SELECT -2 AS 'ErrorCode';
- END;
- END IF;
- END;
- ELSE
- BEGIN
- -- Parameters are not valid --
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('PARAMETER CHECK',sErrorTitle), 'Bad parameters.',USER(),CURRENT_USER() );
- SELECT -1 AS 'ErrorCode';
- END;
- END IF;
-END $$
-
-DELIMITER ;
diff --git a/src/includes-install/database/sp_rentsdel.sql b/src/includes-install/database/sp_rentsdel.sql
deleted file mode 100644
index 267d551..0000000
--- a/src/includes-install/database/sp_rentsdel.sql
+++ /dev/null
@@ -1,128 +0,0 @@
-/*************************************************************************
- * *
- * Copyright (C) 2010 Olivier JULLIEN - PBRAIDERS.COM *
- * Tous droits reserves - All rights reserved *
- * *
- *************************************************************************
- * *
- * Except if expressly provided in a dedicated License Agreement, you *
- * are not authorized to: *
- * *
- * 1. Use, copy, modify or transfer this software component, module or *
- * product, including any accompanying electronic or paper documentation *
- * (together, the "Software"),. *
- * *
- * 2. Remove any product identification, copyright, proprietary notices *
- * or labels from the Software. *
- * *
- * 3. Modify, reverse engineer, decompile, disassemble or otherwise *
- * attempt to reconstruct or discover the source code, or any parts of *
- * it, from the binaries of the Software. *
- * *
- * 4. Create derivative works based on the Software (e.g. incorporating *
- * the Software in another software or commercial product or service *
- * without a proper license). *
- * *
- * By installing or using the "Software", you confirm your acceptance *
- * of the hereabove terms and conditions. *
- * *
- *************************************************************************/
-
-USE `_PBR_DB_DBN_`;
-DELIMITER $$
-
-/*************************************************************************
- * PBRAIDERS.COM *
- * TITLE : sp_RentsDel *
- * AUTHOR : O.JULLIEN *
- * CREATION : 04/02/2010 *
- * DESCRIPTION: Delete old rents *
- * COPYRIGHT : Olivier JULLIEN, All rights reserved *
- *************************************************************************
- * Parameters: *
- * IN sLogin: login identifier *
- * sSession: session identifier *
- * sInet: concatenation of IP and USER_AGENT *
- * iYear: year *
- * *
- * Returns: *
- * ErrorCode: >0 is OK. Number of row deleted. *
- * -1 when a private error occures *
- * -2 when an authentication error occures *
- * -3 when an access denied error occures *
- * -4 when a duplicate error occures *
- *************************************************************************
- * Date * Author * Changes *
- *************************************************************************
- * 04/02/2010 * O.JULLIEN * Creation *
- *************************************************************************/
-DROP PROCEDURE IF EXISTS `_PBR_DB_DBN_`.`sp_RentsDel`$$
-CREATE PROCEDURE `_PBR_DB_DBN_`.`sp_RentsDel`(IN sLogin VARCHAR(45), IN sSession VARCHAR(200), IN sInet VARCHAR(255), IN iYear SMALLINT UNSIGNED )
- SQL SECURITY INVOKER
-BEGIN
- -- ------ --
- -- Define --
- -- ------ --
- DECLARE iErrorCode TINYINT(1) DEFAULT -1;
- DECLARE sErrorUsername VARCHAR(25) DEFAULT 'UNKNOWN';
- DECLARE sErrorTitle TEXT DEFAULT ' IN sp_RentsDel';
- DECLARE sErrorDescription TEXT DEFAULT '';
- DECLARE iUser SMALLINT UNSIGNED DEFAULT 0;
- -- --------------------- --
- -- Define Error Handlers --
- -- --------------------- --
- DECLARE EXIT HANDLER FOR 1061, 1062
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ER_DUP_ occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -4 AS 'ErrorCode';
- END;
- DECLARE EXIT HANDLER FOR 1141, 1142, 1143, 1370
- BEGIN
- INSERT INTO `_PBR_DB_DBN_`.`log`(`logged`,`username`,`type`,`title`,`description`,`mysqluser`,`mysqlcurrentuser`) VALUES (SYSDATE(), sErrorUsername, 'ERROR', CONCAT('SQLEXCEPTION',sErrorTitle), CONCAT('An ACCESS_DENIED occures while processing "',sErrorDescription,'" step. Exit'),USER(),CURRENT_USER() );
- SELECT -3 AS 'ErrorCode';
- END;
- -- ---------- --
- -- Initialize --
- -- ---------- --
- SET sErrorUsername = IFNULL(sLogin,'NULL');
- SET sErrorTitle = CONCAT(sErrorTitle,'(',IFNULL(sLogin,'NULL'),',',IFNULL(sSession,'NULL'),',',IFNULL(sInet,'NULL'),',',IFNULL(iYear,'NULL'),')');
- SET sErrorDescription = 'Check parameters';
- SET sLogin = TRIM(sLogin);
- SET sSession = TRIM(sSession);
- SET sInet=TRIM(sInet);
- -- ------- --
- -- Request --
- -- ------- --
- IF (sLogin IS NOT NULL) AND (LENGTH(sLogin)>0) AND (sSession IS NOT NULL) AND (LENGTH(sSession)>0) AND (sInet IS NOT NULL) AND (LENGTH(sInet)>0) AND (iYear IS NOT NULL) AND (iYear>0) THEN
- BEGIN
- -- Authentication --
- SET sErrorDescription = 'Check authentication';
- CALL sp_SessionValid(sLogin, sSession, 10, sInet, iUser);
- IF (iUser>0) THEN
- BEGIN
- -- Delete --
- SET sErrorDescription = 'Delete';
- DELETE FROM `_PBR_DB_DBN_`.`reservation` WHERE `year` PBRaiders est déjà installée. Si vous souhaitez la re-installer, vous devez dabord la détruire. L'application PBRaiders est déjà installée. Si vous souhaitez la re-installer, vous devez dabord détruire la base de données, effacer le dossier qui contient l'application puis suivre les instructions du fichier lisezmoi.txt. Le nom d'utilisateur ou le mot de passe que vous avez saisi est incorrect. Le nom d'utilisateur ou les mots de passe que vous avez saisis sont incorrects. Création des procédures stockées:OK Note: PBRaiders est configuré et est complètement opérationnel pour fonctionner sans. Si vous souhaitez forcer PBRaiders à les utiliser vous devez modifier le fichier config.php. Note: PBRaiders est correctement configuré pour les utiliser. Création des procédures stockées:ECHEC Note: cela ne pose aucun problème car PBRaiders est configuré et est complètement opérationnel pour fonctionner sans. ATTENTION: vous devez modifier le fichier config.php pour forcer PBRaiders à fonctionner sans. Installation réussie. Une fois que vous aurez vérifié que tout fonctionne correctement, vous devez effacer le fichier install.php et le dossier includes-install Release CAMP ©JOT 2010
Suppression réussie.
'; } elseif($iCode===3) { @@ -136,7 +137,7 @@ function BuildMessage($iCode) diff --git a/src/includes/display/displayusers.php b/src/includes/display/displayusers.php index acedb9a..5f0c18f 100644 --- a/src/includes/display/displayusers.php +++ b/src/includes/display/displayusers.php @@ -35,6 +35,7 @@ * - $tRecordset * - CNewUser * author: Olivier JULLIEN - 2010-02-04 + * update: Olivier JULLIEN - 2010-06-11 - add password check *************************************************************************/ if ( !defined('PBR_VERSION') || !defined('PBR_URL') || !defined('PBR_NEWUSER_LOADED') ) die('-1'); @@ -53,7 +54,7 @@ function BuildMessage($iCode) $sBuffer='Le nom d'utilisateur ou le mot de passe que vous avez saisi est incorrect.
'; + $sBuffer.='Le nom d'utilisateur ou les mots de passe que vous avez saisis sont incorrects.
'; } elseif($iCode===2) { @@ -116,7 +117,9 @@ function BuildUser(&$tRecord) $sFormHidden=''; $sFormHidden.=''; $sFormHidden.=''; - $sDisable='disabled="disabled"'; + // Build name label + $sDisable='disabled="disabled"'; + $sLabelName='Nom'; $sHelp=''; // Build state control $sState='