Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Nedeľa, 29. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Preventing editing of URL to access unauthorised records?

phpMyEdit Configuration     Preventing editing of URL to access unauthorised records?
Odoslať novú tému   Odpovedať na tému    
 
ukdevil     Založený: 05.10.2009   Príspevky: 2  
Príspevok Zaslal: 2009-10-05 15:53
Návrat hore  Odpovedať s citátom     

Hi,

Sorry for the rather vague post title but hopefully I can explain -

I have a table of data, contributed to by various people who log into an online system. The username they use determines the records they see in the table, using $opts['filters'] = .... etc

However, when using the graphical links, you get a URL something like this - PME_sys_fl=0&PME_sys_fm=0&PME_sys_sfn[0]=2&PME_sys_operation=PME_op_Copy&PME_sys_rec=15 after the main site address and by just changing the 'rec' number at the end of the address, a user can access any record in the system. If I use the buttons, that would mask the URL a bit but if someone knew phpmyedit, I would imagine they could work out the URL they needed.

Does phpmyedit support any kind of access control within a table. I've been really impressed with phpmyedit so far but unless I can prevent users accessing certain records, I'm going to have to use something else.. so any assistance would be great!

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2009-10-07 13:41
Návrat hore  Odpovedať s citátom     

Other than filters, there is no access control. Everyone has different needs. You will likely need to develop a custom PHP solution which validates every request before displaying records. If records are associated with specific user names (not shared by multiple users) and the user name is saved as a session variable when users log in, then you might be able to use PHP to evaluate requests in the page header and restrict access.

 
ukdevil     Založený: 05.10.2009   Príspevky: 2  
Príspevok Zaslal: 2009-10-07 13:46
Návrat hore  Odpovedať s citátom     

Thanks for the reply Doug. It confirms what I suspected. I think I'll use phpmyedit for some pages and on others I'll just do custom code. Oh well :)

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2009-10-07 13:57
Návrat hore  Odpovedať s citátom     

I have a PHP application that displays navigation links based on the user level associated with each page ID, plus whether or not the user is logged in. You might work out a similar filter for your project, checking the request string for certain phpMyEdit variables and querying the database in advance of displaying the form.

Kód:
// mli is an acronym for "must log in"
// ul is an acronym for "user level"

$where = 'WHERE `forum_id` = "'.$f.'" AND `hidden` = "0" AND `deleted` = "0"';

if( isset($_GET['logout']) || empty($_SESSION['user_name']) ){

   $where .= ' AND `mli` = "0"';

}elseif(!empty($_SESSION['user_name'])){

   if(in_array($f, $opts['mli_ary'])){

      $where .= ' AND `mli` = "1" AND `ul` <= "'.$_SESSION['user_level'].'"';

   }else{

      $where .= ' AND `mli` = "0"';

   }

}

$qry = 'SELECT `id`, `link`, `thread_id`, `level`, `nav`
   FROM `'.$opts['db'].'` . `'.$opts['tb'].'`
   '.$where.'
   ORDER BY `thread_id` , `thread_pos`';


See also
http://opensource.platon.sk/forum/projects/viewtopic.php?t=170434&highlight=pmeopview

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov