[fpc-pascal] FCL Web Combined Demo
Dimitrios Chr. Ioannidis
d.ioannidis at artesoft.gr
Mon Nov 21 13:50:03 CET 2011
On 21/11/2011 2:37 μμ, michael.vancanneyt at wisa.be wrote:
>
>
> On Mon, 21 Nov 2011, Dimitrios Chr. Ioannidis wrote:
>
>>
>> On 21/11/2011 1:28 μμ, michael.vancanneyt at wisa.be wrote:
>>>
>>> IE has a bug that causes it to report an error if the last element
>>> in an
>>> array or object is empty. (it is explicitly mentioned in the
>>> standard that
>>> it is allowed).
>>>
>>> So you should search for a , in front of } and ] and remove it.
>>>
>>
>> Thx. I fixed the script and it worked.
>
> Did you need to do additional fixes beyond the ones I did ?
>
For the users.js file no i didn't.
The changes for the demo to work was, a modification of the combined.cgi
path in users.js and login.js and in the Database the addition of the BU
Trigger to protect the demo user.
CREATE GENERATOR GEN_USERS;
CREATE TABLE USERS
(
U_ID Bigint NOT NULL,
U_LOGIN Varchar(40) NOT NULL,
U_NAME Varchar(30) NOT NULL,
U_EMAIL Varchar(100),
U_PASSWORD Varchar(100) NOT NULL,
CONSTRAINT PK_FPCUSERS PRIMARY KEY (U_ID),
CONSTRAINT U_USERNAME UNIQUE (U_LOGIN)
);
CREATE EXCEPTION DEMOUSER
'Demo user deletion or update Prohibited !';
/******************** TRIGGERS ********************/
SET TERM ^ ;
CREATE TRIGGER USERS_BD_BU FOR USERS ACTIVE
BEFORE UPDATE OR DELETE POSITION 0
AS
BEGIN
IF (OLD.U_ID = 1) THEN EXCEPTION DEMOUSER;
END^
SET TERM ; ^
SET TERM ^ ;
CREATE TRIGGER USERS_BI FOR USERS ACTIVE
BEFORE INSERT POSITION 0
AS
DECLARE VARIABLE tmp DECIMAL(18,0);
BEGIN
IF (NEW.U_ID IS NULL) THEN
NEW.U_ID = GEN_ID(GEN_USERS, 1);
ELSE
BEGIN
tmp = GEN_ID(GEN_USERS, 0);
if (tmp < new.U_ID) then
tmp = GEN_ID(GEN_USERS, new.U_ID-tmp);
END
END^
SET TERM ; ^
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
ON USERS TO SYSDBA WITH GRANT OPTION;
regards,
--
Dimitrios Chr. Ioannidis
More information about the fpc-pascal
mailing list