Jump to content

Close logins


dryline

Recommended Posts

You can create this manually.

 

In the root of the whmcs install, open index.php.

 

Add this just below "<?php":

 

include('systemstatus.php');

 

Create a new file in the root of your whmcs install called systemstatus.php.

 

In that file put this code:

 

<?php

 

$systemstatus = '1'; // '1' for online, '0' for offline

 

 

if($systemstatus == '0')

{

include('offline.php');

}

 

?>

 

Save that.

 

The next thing you can do is create a nice offline page and save that page as offline.php.

 

Somebody could easily take that and create a module for this, I haven't tackled it yet but it should be very hard.

Link to comment
Share on other sites

Hey that's great thanks! You're right about missing posts. I tried to diligently find an answer before I post, and it seems I always miss it somehow.

 

Matt did confirm in support ticket that you can't close logins at this time as it comes out of the box.

 

That would be a very useful feature to have, particularly during times your upgrading the software etc. Almost necessary actually.

Link to comment
Share on other sites

That's what I thought too, hence why I posted to the feature request.

 

Now I did learn that your server will have to have suphp added as a module on the server. It is needed to create the file it makes and to set the properties correctly in order for it to be removed with the maintenance is turned off.

 

I have mentioned to the creator that it could be changed to be used without the file being created in the root of the whmcs installation. I would have changed it myself but the module has been encoded with ioncube.

Link to comment
Share on other sites

Let me explain it a little better for you.

Without suphp you web server runs php scripts as the web server user (usually "nobody" or "apache"). So the php script tries to create a file with the group and user id of "nobody" into your web hosting space.

 

Now if the server actually allows a different userid to create a file in your hosting space

1. its a big security hole for the entire server

2. When you log into your site you see the file there but you cannot delete it because you dont have permissions to even access the file. You then would have to bug your hosting tech support to remove/chmod it for you.

 

Simply said, with suphp the php script runs with your userid/group permissions and your server is much more secure.

Try doing a google search for "suphp" and find out for yourself what else it is usefull for.

 

Yes I can modify it to create the file in a tmp directory which would need 0777 perms.

 

Remember this mod is FREE!!

 

If you require a custom version of it then open a sales ticket on my site and ask for it.

Link to comment
Share on other sites

Hi Sparky!

 

I love the mod and I have read up on suphp. It is a great tool.

 

I totally understand setting a directory to 777 is not ideal. I would suggest that your module could use FTP to move the file - not to mention it would have the correct permissions with a devoted FTP account for it.

 

For example:

 

// User Info
$ftp_user_name = 'whmcs_maintenance';
$ftp_user_pass = 'password';
$ftp_server = 'ftp.whmcsserver.com';

// Connect to Server
$conn_id = ftp_connect($ftp_server);

// Login to Server
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// Open the folder
ftp_chdir($conn_id, '/public_html/testing/test/');

// Rename the file to another directory
ftp_rename($conn_id, '/public_html/testing/test/offline.php', '/public_html/testing/offline.php');

 

You can then remove the 'offline.php' file when you disable the maintenance mode using FTP.

 

No disrespect for an excellent module, just a suggestion for those of us that do not have the rights to add suphp.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated