Elxis CMS Forum

Extensions => Components => Topic started by: de-active on April 07, 2010, 03:37:27

Title: IOS Reservations and Super Admins
Post by: de-active on April 07, 2010, 03:37:27
Hi,
I have more than one Super Administrator on my site (I don't want it but only created super administrators because there was no other ways that other users could access the component IOSR.

So I have three questions:

1. I don't want all the superadministrators to receive emails from IOSR regarding bookings
2. Can I create users who only have access to IOSR?
3. How do I delete a super administrator as I have more than one?

Thank you.
Title: Re: IOS Reservations and Super Admins
Post by: datahell on April 07, 2010, 20:58:48
(1) You have to edit file:
administrator/components/com_reservations/includes/resmailer.class.php
For the reservation e-mails, function "sendReserveMail" line 300.
Find this:

if ($resmaster->cfg->get('RESNOTIFYOWN') && ($hotel->owneremail != '')) {
   $query = "SELECT id, name, email, preflang FROM #__users WHERE (gid='25' OR id='".$hotel->ownerid."') AND block='0' ORDER BY preflang";
} else {
   $query = "SELECT id, name, email, preflang FROM #__users WHERE gid='25' AND block='0' ORDER BY preflang";
}

Change the query into this:

if ($resmaster->cfg->get('RESNOTIFYOWN') && ($hotel->owneremail != '')) {
   $query = "SELECT id, name, email, preflang FROM #__users WHERE (id='62' OR id='".$hotel->ownerid."') AND block='0' ORDER BY preflang";
} else {
   $query = "SELECT id, name, email, preflang FROM #__users WHERE id='62' AND block='0' ORDER BY preflang";
}

This way the system will send e-mail only to the pre-defined administrator with id 62 (normally username: admin)
Do the same for the other e-mails the system sends (cancellation, contact, etc).

(2) The easiest solution is to add a (under conditions) redirect to the administration's index2.php and index3.php files

Example (placed on line 82  in index2.php, same for index3.php)

if ((intval($my->id) != 62) && ($option != 'com_reservations') && ($task != 'promptlogout')) {
        mosRedirect('index2.php?option=com_reservations');
}

(3) You can not delete him, but you can block him. It has the same affect.