Forums | Mahara Community

Developers /
Closing Site Function and Error Messages


anonymous profile picture
Deleted user
Posts: 112

28 March 2010, 3:27 PM

Hello All,

   We're back to hacking the core files again and I have a few questions that might help us in our next project. When an admin closes a mahara site a pinkish bar is shown at the top of the web page. Only members with access rights can login and view the website. We have changed how this works and need a little help with the functionality. 

In the header.tpl we added the following code:

<?php
header("Location: http://unavailable.oursite.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

This allows users to view a professional page that gives details about what's going on and how long the site will be down. My question regarding this is how can we allow our developers to see pages that are developing with this method of redirect? Having this setup is more professional in our opinion. I have read through the php manuel but, can't seem to find a solution. Does anyone here have a solution that I could try? 

My second question is for errors that mahara might throw out. How can we have errors show up on a simple page like the maintenance page for our site. I haven't been able to figure out how to add a redirect to unavailable.mysite.com/error/  for these errors yet. The page would give developers the error message and at the same time give non-technical users a simple message. We also would like to add tips to these pages that would help the user to access the site again. Many sites use this method and shouldn't be too hard to accomplish (e.g. twitter).

I hope I explained this accurate for people to understand. If there are any questions please ask me and I can try to explain better. 

Thanks,

anonymous profile picture
Deleted user
Posts: 112

28 March 2010, 8:15 PM

This is a response to my second question in my first post. When mahara calls an error does it come directly from the errors.php in the lib directory. I have been playing around with the redirect but, the only issue is getting the error information to display on the unavailable.mysite.com url. 
anonymous profile picture
Deleted user
Posts: 112

28 March 2010, 11:21 PM

Well after a few hours I have came to a decision. I was thinking why do users need to see the error messages? Seeing error messages on your screen for a user will become annoying in time so, we removed the error messages all together. This is what error logs are for anyways. Now when an error occures the user will see a message stating someone has dropped the ball. There is additional informational that assures the user that we're working hard to corrrect the issue. From this page they can return to the home page or other parts of the site that isn't affected by the error. Once the error is fixed that section is no longer redirected. 

If anyone can argue that these messages are important for users to see then I will go back to develop this function. Any input is always welcomed!

Cheers,

Allen

3 results