I want to know if there is a tutorial on how to create a user login for access to scriptcase generated applications?
Otherwise, can someone provide guidance or examples?
I want to know if there is a tutorial on how to create a user login for access to scriptcase generated applications?
Otherwise, can someone provide guidance or examples?
Re: How to Create User Login Form for Applications
i think there is a login tutorial. if you look on their site, there is a section that has a lot of tutorials.
Re: How to Create User Login Form for Applications
Create a ‘Control’ app
Add 2 field (login/pass)
Event: onValidate (compare values from table with fields)
These are the basics.
Regards,
Scott.
Re: How to Create User Login Form for Applications
Hi,
There appears to be a built in security module located at File > New Modules > Security. I would like to use native modules as much as possible. I was able to go through the prompts and create a security module using user/group/app.
It was fairly straight forward to enter my details for all of my tables but now upon launching I am presented with a scren that says “Unauthorized user.”
How do i make it so i am prompted with the login form if not logged in ? Right now I get a message saying "Unauthorized user " when I launch my initial menu app.
Even when i launch the login control application directly and my username/password is successful it says "Unauthorized user ".
I have to say that the tutorials are limited and not very granular.
This is basic functionality I would have expected there to be more documentation for it. In fact, I will write one after I solve this problem. Your assistance is appreciated.
Re: How to Create User Login Form for Applications
I have never used the Security Module(SM), so I will have to take a look.
The login(SM) will have to be run first, as the menu (and other apps) will be looking for the OK from SM to run.
You can redirect to login on error using the Application/Navigation or in code using sc_redir()
Have you set the options to Yes in the Security option for each of the other apps after creating the SM? They default to No.
Regards,
Scott.
Re: How to Create User Login Form for Applications
it does sound like you just need to enable security on your other apps. but just in case that’s not it, make sure scriptcase has the correct file permissions.
Re: How to Create User Login Form for Applications
I figured out the problem.
The security module asks for certain fields but doesn’t tell us how to arrange the database columns.
In my users table, i use userid, and username. In my groups, I use groupID and groupname. And in my application table i used appID and appname. I typically link tables using the “ID” fields as opposed the name fields as names may change.
The security module asked for ‘application code’ and application description and I made the mistake of thinking ‘code’ was synonymous with the id field an dthe description was the application name (which would make sense) but it is not the way the wizard produced the sql statement. I just looked at the generated sql statement for the generated control app and modified it so it was looking at the correct fields and problem solved.
Thanks for your help. Scriptcase is a solid application and has saved me a lot of time. If anyone needs assistance feel free to ask me.
Re: How to Create User Login Form for Applications
i checked my fields but the problem is still the same. I copied the sql statement and replaced the login variable with admin and got the list of applications im allowed, but i still encounter ‘Unauthorized User’ like what you encountered before.
Please help
Re: How to Create User Login Form for Applications
Hi Marlon, which security module option did u you use?
user/app
or user/group/app?
Re: How to Create User Login Form for Applications
This “Security Module” thing is driving me crazy. I’m looking back with envy at the almost elegant way PHPrunner handles this in comparison. I digress…
I have, as best I can, followed the instructions on creating a secured application using a control application.
The on-validate event is supposed to throw a “Access Denied!” message if an invalid log in attempt occurs.
But when I run the application and enter what I know should be a valid account, I get a “UNauthorized User” message.
It seems the onvalidate event is never processed. Something is trapping the log in before it gets there and popping up the “Unauthorized User” message, which is not my code.
Anyone know what might be happening?
Thanks
Re: How to Create User Login Form for Applications
Not the throw a wrench the works, but I do often … how about creating your own login form (control) and set some session variables (from a table) and check for this variables in your forms.
(name, levels, access, etc)
That is what I do, … and you will not be held hostage.
Regards,
Scott.
Re: How to Create User Login Form for Applications
Hi,
http://www.scriptcase.net/forum_en_us/index.php?topic=1423.0
You can check in your database if the values are correct.
Regards,
V?tor Jamil
reply this post
Something alike was discussed on the ask.com,i can give someone a link if anybody need it
Re: How to Create User Login Form for Applications
In http://www.scriptcase.net/forum_en_us/index.php?topic=1423.0 the script provided has some error:
– Table tb_user_applications
CREATE TABLE IF NOT EXISTS tb_user_applications (
fk_user_login VARCHAR(20) NOT NULL ,
fk_interface_name VARCHAR(150) NOT NULL ,
PRIMARY KEY (fk_user_login, fk_interface_name) ,
INDEX tb_users_applications_ibfk_2 (fk_interface_name ASC) ,
CONSTRAINT tb_users_applications_ibfk_1
FOREIGN KEY (fk_user_login)
REFERENCES tb_users (login),
CONSTRAINT tb_users_applications_ibfk_2
FOREIGN KEY (fk_interface_name)
REFERENCES tb_applications (name))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
mysql show a error message, can you helpmme about this
Re: How to Create User Login Form for Applications
the complete mysql is here :
– Table tb_applications
CREATE TABLE IF NOT EXISTS tb_applications (
name VARCHAR(150) NOT NULL ,
description VARCHAR(170) NULL DEFAULT NULL ,
PRIMARY KEY (name) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
– Table tb_groups
CREATE TABLE IF NOT EXISTS tb_groups (
code INT(11) NOT NULL AUTO_INCREMENT ,
description VARCHAR(50) NULL DEFAULT NULL ,
PRIMARY KEY (code) ,
UNIQUE INDEX XPKtbgroupuser (code ASC) )
ENGINE = InnoDB
AUTO_INCREMENT = 7
DEFAULT CHARACTER SET = latin1;
– Table tb_groups_x_apps
CREATE TABLE IF NOT EXISTS tb_groups_x_apps (
cod_group INT(11) NOT NULL DEFAULT ‘0’ ,
cod_application VARCHAR(150) NOT NULL ,
PRIMARY KEY (cod_group, cod_application) ,
UNIQUE INDEX XPKtbgroupxrights (cod_group ASC, cod_application ASC) ,
INDEX tb_groups_x_apps_ibfk_2 (cod_application ASC) ,
CONSTRAINT tb_groups_x_apps_ibfk_1
FOREIGN KEY (cod_group)
REFERENCES tb_groups (code),
CONSTRAINT tb_groups_x_apps_ibfk_2
FOREIGN KEY (cod_application)
REFERENCES tb_applications (name))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
– Table tb_users
CREATE TABLE IF NOT EXISTS tb_users (
login VARCHAR(20) NOT NULL DEFAULT ‘’ ,
password VARCHAR(40) NULL DEFAULT NULL ,
name CHAR(50) NULL DEFAULT NULL ,
email VARCHAR(100) NULL DEFAULT NULL ,
PRIMARY KEY (login) )
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
– Table tb_user_applications
CREATE TABLE IF NOT EXISTS tb_user_applications (
fk_user_login VARCHAR(20) NOT NULL ,
fk_interface_name VARCHAR(150) NOT NULL ,
PRIMARY KEY (fk_user_login, fk_interface_name) ,
INDEX tb_users_applications_ibfk_2 (fk_interface_name ASC) ,
CONSTRAINT tb_users_applications_ibfk_1
FOREIGN KEY (fk_user_login)
REFERENCES tb_users (login),
CONSTRAINT tb_users_applications_ibfk_2
FOREIGN KEY (fk_interface_name)
REFERENCES tb_applications (name))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
– Table tb_users_x_groups
CREATE TABLE IF NOT EXISTS tb_users_x_groups (
login VARCHAR(20) NOT NULL DEFAULT ‘’ ,
cod_group INT(11) NOT NULL DEFAULT ‘0’ ,
UNIQUE INDEX XPKtbgroupsxusers (cod_group ASC, login ASC) ,
INDEX tb_users_x_groups_ibfk_1 (login ASC) ,
CONSTRAINT tb_users_x_groups_ibfk_1
FOREIGN KEY (login)
REFERENCES tb_users (login),
CONSTRAINT tb_users_x_groups_ibfk_2
FOREIGN KEY (cod_group)
REFERENCES tb_groups (code))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
when you running this sql, you should create database first same as you application
hope it help