How do I create a user with view access only?

ufoboi

New member
Hello,

I new with Dababik, I just donated & downloaded dadabik_4.4_pl1 version. I've created a normal user account from phpMyAdmin which doesn't have access to Admin area. I don't want the normal user to create, edit or delete data. Could someone give me info how to set this up?
 

ufoboi

New member
DebbieS Wrote:
-------------------------------------------------------
> I believe you can set the options in config.php to
> turn off all but view for normal users.


I've check all the settings in config.php but I couldn't locate anywhere to change it.
 

DebbieS

DaDaBIK Guru
You don't have these settings in config.php?

// enable delete authorization, only who inserted a record can delete it (0|1)
$enable_delete_authorization = 1;

// enable update authorization, only who inserted a record can modify it (0|1)
$enable_update_authorization = 1;

// enable browse authorization, only who inserted a record can view it (0|1)
$enable_browse_authorization = 1;

// enable delete all feature (delete feature must be enabled too, from the administration interface) (0|1)
$enable_delete_all_feature = 0;

If you set all except $enable_browse_authorization to 0, normal user should have only view access.
 

ufoboi

New member
Thank you for taking time to help me. I did have all those configuration set to 0 but the normal user still have Delete, Create icons/menu. :(
 

ufoboi

New member
I'm wondering if i create normal user the right way. I use phpMyAdmin and edit user_tab table

id_user = 2
user_type_user = normal
username_user = demo
password_user = (md5 encrypted key)
 

DebbieS

DaDaBIK Guru
My apologies ... those settings are in place for allowing edit/delete/view for the records they created - not globally (thanks Eugenio for the reminder).
The best way to do this would be to create a separate "install".

I'll get back to you with the particulars after I double check them tomorrow.
 

eugenio

Administrator
Staff member
Just want to add on the side that you can add/manage users via DaDaBIK, without PHPMyAdmin.
 

ufoboi

New member
DebbieS: thanks.


eugenio: There is no add or manage user area, I went into the Administration but I only see "Change". .
 

eugenio

Administrator
Staff member
If you log in as administrator, you can manage the users table as another normal table in DaDaBIK and you can also crypt the passwords.
 

ufoboi

New member
I'm logged in as Administrator & in "Admin Home" tab but I still don't know where to add new user. I can only change the table field names.
 

eugenio

Administrator
Staff member
You don't have to go in the admin section, the users table is just another table in the normal view. Look at the table listbox.
 

ufoboi

New member
eugenio: Got it. Thank you very much. While Debbie is still searching for answers. Could you also help me create a normal user with view access only? I don't want to display "EDIT, Delete" or "create new" features.
 

DebbieS

DaDaBIK Guru
Create view only:

Make a copy of index.php - name it indexmaster.php.

In indexmaster.php, comment out the config.php line.

Change the contents of index.php (after the copyright block) to read
[pre]
<?php
include ("./include/config.php");
include ("./indexmaster.php");
?>
[/pre]


Make a copy of index.php - name it indexRO.php.

Make a copy of config.php - name it configRO.php.

File changes:
indexRO.php ... change reference to config file to point to new configRO.php:
[pre]
<?php
include ("./include/configRO.php");
include ("./indexmaster.php");
?>
[/pre]

configRO.php:
$dadabik_main_file = "indexRO.php";
authentication options - set all to 0 except $enable_authentication = 1; ... leave that at 1
$table_list_name = "dadabik_table_listro"; // copy dadabik_table_list to dadabik_table_listro using phpMyAdmin - then you can use same to turn off insert and whatever other stuff in there for each table listed.

header.php (I put this right in after the opening <head> tag):
[pre]
if (($current_user_is_administrator != 1) && ($_SERVER['SCRIPT_NAME'] == $site_url."index.php")) {
header ("Location: ".$site_url."/indexRO.php");
}
[/pre]

Give that a whirl and let me know - I had to put this together from memory because I forgot to look at my other install at work.
If you have any questions, let me know.
 
Top