This topic is locked

Advanced Security Settings?

6/30/2007 7:37:01 PM
PHPRunner General questions
C
chaz author

UsersTable: Owner ID field


can this be changed to a new Table/field?

Sergey Kornilov admin 7/2/2007

What exactly do you mean?

C
chaz author 7/2/2007

well u have the login from account login and pass but i need another check when editing, and that check comes from another table/field.
login: login

pass: pass
ownerid: subgroup

C
chaz author 7/2/2007
$rs=db_query($strSQL,$conn);

$data=db_fetch_array($rs);
$strSQLExtra = "select 'guid' from 'characters' where 'acct' = $data['acct'] ";

$rsExtra = db_query($strSQLExtra,$conn);

$data1=db_fetch_array($rsExtra);



if($data && @$data[$cUserNameField]==$sUsername && @$data[$cPasswordField]==$sPassword)

{

$_SESSION["UserID"] = postvalue("username");

$_SESSION["AccessLevel"] = ACCESS_LEVEL_USER;

if(postvalue("username")==$cAdminUserID)

$_SESSION["AccessLevel"] = ACCESS_LEVEL_ADMIN;

$_SESSION["OwnerID"] = $data1["guid"];

$_SESSION["GroupID"] = $data["login"];


why wont this work?? basically the tying link is the acct field
ie
table

accounts.acct.login/pass

table

characters.acct.guid

Sergey Kornilov admin 7/2/2007

I suggest to use AfterSuccessfulLogin event to run a SQL query that retrieves Guid field from another table.

After that you can save it in $_SESSION["OwnerID"] variable.