This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Password Protected Directories For Windows
#1
Password Protected Directories For Windows
Dont know how many people are interested in it, but i have got the password protected directories module running on windows. Only required a few modifications to the module to get it working fully.

The things that were preventing the module from running properly:
File: controller.ext.php
Line: 415
Issue: The if statement is checking if the user is staying in there home directory, only issue is that linux path separators are not being converted to windows
Before: if( 0 !== strpos($realPath, self::getHostDir() . self::getCurrentUsername() . '/'))
After: if( 0 !== strpos($realPath, realpath(self::getHostDir() . self::getCurrentUsername() . '/')))

File: controller.ext.php
Line: 424 & 849
Issue: The method of encrypting the password that is used does not work on windows. We fix it by adding a method to the bottom of the code that works on all platforms and replacing the calls to crypt.
Before: $encryptedPassword = crypt($password, base64_encode($password));
After: $encryptedPassword = self::crypt_apr1_md5($password);

After these changes i was able to create, delete, as well as modify users as well as the actual password files.

To install just download my already modified zip, run the SQL script in phpmyadmin on the sentora_core database to create the required tables, and install the module zpp.


Attached Files
.zip   protected_directories.zip (Size: 11.31 KB / Downloads: 38)
Reply
Thanks given by: TGates , xtec
#2
RE: Password Protected Directories For Windows
Nice work! Will test this out.
-TGates - Head of Support

SEARCH the Forums or read the DOCUMENTATION before posting!
Modules Maintained: 13 - Module Installs: 108k+

Find my support or modules helpful? Donate HERE
Get your domains using my affiliate link:
GoDaddy - Domains
Reply
Thanks given by:
#3
RE: Password Protected Directories For Windows
(04-09-2015, 12:26 PM)VeryCrushed Wrote: Dont know how many people are interested in it, but i have got the password protected directories module running on windows. Only required a few modifications to the module to get it working fully.

The things that were preventing the module from running properly:
File: controller.ext.php
Line: 415
Issue: The if statement is checking if the user is staying in there home directory, only issue is that linux path separators are not being converted to windows
Before: if( 0 !== strpos($realPath, self::getHostDir() . self::getCurrentUsername() . '/'))
After: if( 0 !== strpos($realPath, realpath(self::getHostDir() . self::getCurrentUsername() . '/')))

File: controller.ext.php
Line: 424 & 849
Issue: The method of encrypting the password that is used does not work on windows. We fix it by adding a method to the bottom of the code that works on all platforms and replacing the calls to crypt.
Before: $encryptedPassword = crypt($password, base64_encode($password));
After: $encryptedPassword = self::crypt_apr1_md5($password);

After these changes i was able to create, delete, as well as modify users as well as the actual password files.

To install just download my already modified zip, run the SQL script in phpmyadmin on the sentora_core database to create the required tables, and install the module zpp.

It's Great!
I ruled out the module from Sentora for Windows.
This module is used in practice, only 1% of users hosting.
But anyway thank you very much !!!
This is a very valuable investment!
Reply
Thanks given by:


Possibly Related Threads...
Thread Author Replies Views Last Post
ZPanel 10.1.1 -> Sentora 1.0.3 Windows Version TGates 17 25 512 03-01-2021, 08:13 AM
Last Post: ccr1969
Sentora on Windows ANY NEW INSTALLER elmoutakaf 3 4 835 10-04-2020, 02:37 AM
Last Post: Gigamax
Sentora for Windows 1.0.0 released! MarkDark 70 139 542 07-08-2020, 09:58 PM
Last Post: andykimpe

Forum Jump:


Users browsing this thread: 1 Guest(s)