This topic is locked

Warning! PHPRunner6.0.9948 version deletes all old ugrights table records

1/12/2012 1:51:02 AM
PHPRunner General questions
R
Rigmantas author

Hi,

I work with my projects about six years. Sometimes I using PHPRunner. In project I using one and the same table for permissions. I created new application with PHPRunner6.0.9948 and: o my God! all about 2000 permissions records in ugrights table has been deleted. Survivor, I had backups. PHPRunner program I have always trusted, but now ... need all to check this before allowing a new project. But PHPRunner is best <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=18685&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />.

Maybe it's my mistake ...

I'm sorry

Rimantas

Sergey Kornilov admin 1/12/2012

Rigmantas,
PHPRunner never deletes permissions data. It simply doesn't have such a functionality. Let me know if you need any help in this regard.

R
Rigmantas author 1/20/2012

OK,

When I press save button in admin_rights_list.php page I found this in mysql log:

10 Query select GroupID from users_ugmembers where UserName='admin'

10 Query select TableName,AccessMask from users_ugrights where GroupID in (32,30,24,23,-1,17,12,10,3)

[color="#8B0000"]10 Query delete from users_ugrights

10 Query insert into users_ugrights (TableName,GroupID,AccessMask)

values ('test_table', -1, 'SPM') ........[/color]

Rimantas

Sergey Kornilov admin 1/20/2012

You are confusing PHPRunner and PHP application generated by PHPRunner.
admin_rights_list page in fact updates permissions by deleting and adding permissions. This is the way how it always worked.

R
Rigmantas author 1/22/2012



You are confusing PHPRunner and PHP application generated by PHPRunner.
admin_rights_list page in fact updates permissions by deleting and adding permissions. This is the way how it always worked.


Hi,

In red query lack of conditions "where"

In PHPrunner5.3 this query looks like this"

delete from users_ugrights where TableName='test_table'
And second in PHPrunner5.3 rightspage.php i found that:

$sql="delete from ##@BUILDER.strUGRights ts## where TableName='".db_addslashes($table)."'";

db_exec($sql,$this->conn);

in PHPrunner6.0 ug_group.php:
and next: I replace next string in ug_group.php:

[color="#000080"]db_exec("delete from ##@BUILDER.strUGRights ts##", $conn);

$realTables = GetRealValues();

with next:
$realTables = GetRealValues();

for($i=0;$i<count($realTables);$i++)

{

db_exec("delete from vartotojai_ugrights where TableName='".$realTables[$i]."'", $conn);

}

I did a test and it seems that everything is okay. What do you think?

Best regards,

Rimantas