This topic is locked

Advanced Security Options

4/25/2008 2:46:10 PM
PHPRunner General questions
C
cglaeser author

In the section Advanced Security Options, the manual states:
2. Users can see and edit their own data only
This option allows to restrict users to view and edit their own records only. To use this option you need to set a relationship between table that holds usernames and passwords and main data table.


Is there a more detailed explanation on how to complete this task? I added a field LoginID to the jobs table (I'm using the Jobs template), but I'm not quite sure how to link the LoginID to the login table so the LoginID field shows up in the security dialog box.
Best,

Christopher

E
echo 4/25/2008

christopher. i can start you off with the way i do it with my sites but should be the same for phpr. create a table which holds your user table. like thus
[codebox]CREATE TABLE `user_usr` (

`id_usr` int(11) NOT NULL auto_increment,

`idcode_usr` varchar(99) NOT NULL,

`idcom_usr` int(11) default NULL,

`name_usr` varchar(50) NOT NULL,

`ntries_usr` smallint(6) NOT NULL,

`password_usr` varchar(100) NOT NULL default '',

`username_usr` varchar(15) NOT NULL,

`active_usr` tinyint(4) NOT NULL,

`level_usr` tinyint(2) NOT NULL,

`email_usr` varchar(100) NOT NULL default '',

`random_usr` varchar(32) NOT NULL,

`disabledate_usr` date NOT NULL default '0000-00-00',

`bill_address_usr` varchar(150) NOT NULL,

`lastlogin_usr` datetime NOT NULL default '0000-00-00 00:00:00',

`logincounter_usr` int(11) NOT NULL,

`ip_usr` varchar(25) NOT NULL,

PRIMARY KEY (`id_usr`)

) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=18 ;[/codebox]
the 3 main fields are: id_usr, username_usr and password_usr. the email field is for the forgot password option. you also have level, which i user numeric but you can use, user, admin etc. in another table say products, you will have one of the fields which will be foreign to the user table. say, idusr_pro for the product table. this will tie in with the id_usr of your main table. this should give you a start. if you need any help, just shout and i'm sure w'll chip in. good luck.

Sergey Kornilov admin 4/25/2008

Once you have LoginID field in Jobs table it should appear on dropdown box. Just make sure LoginID field in Jobs table has the same data type as LoginID in Users table.
If this doesn't work for you this way send the screenshot that explains this issue to support@xlinesoft.com.