Masks-table crypted columns

Ask all your questions about the script here.
Teme
New
Posts: 5
Joined: Mon May 25, 2015 6:11 am

Masks-table crypted columns

Postby Teme » Wed Apr 13, 2016 6:43 am

I'm creating an automated provisioning system to my project and I use Quadodo as my login system.

In my system I create user with their own pages and directories etc.
I'm able to create masks, groups, users and all the pages needed with the same script to qls, also. The problem is when I try to couple the permissions for a page with mask created. Every newly added page creates a columb at the end of masks table with some crypted string as their name. My best ques to form the column name was like this:

Code: Select all

   $crypt_pagename = sha1($_POST['pagename']);
   $column_name = "auth_".$crypt_pagename;
   $set = array($column_name => 1);
   $return = $qls->SQL->update('masks', $set, array('id' => array('=', $_SESSION['mask_id'])));


..but that gives me an error of "1054: Unknown column 'auth_02aa5d5e00c82807fde9b573b1a89392a24b5455' in 'field list'" =(

So how can I refer to a column referring to page name in masks table, to automatically give a new mask a permission to a new page? Does the qls system make some string modification to the pagename before hashing it with sha1?

Thanks,
Teemu
Teme
New
Posts: 5
Joined: Mon May 25, 2015 6:11 am

Re: Masks-table crypted columns

Postby Teme » Wed Apr 13, 2016 7:06 am

And immediately answerring to my self:

The hash is not made from pagename, but page id. That was where I went wrong. Just move the firs line in my question post's code to this

Code: Select all

$crypt_pageid = sha1($qls->page_name_to_id($_POST['pagename']));

and it works.

Cheers!
- teemu

Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest