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
#2
RE: Password Protected Directories For Windows
Nice work! Will test this out.
-TGates - Project Council

SEARCH the Forums or read theĀ DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
#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


Possibly Related Threads…
Thread Author Replies Views Last Post
Sentora for Windows 1.0.0 released! MarkDark 72 274 ,383 04-01-2022, 09:41 PM
Last Post: cathelest
ZPanel 10.1.1 -> Sentora 1.0.3 Windows Version TGates 20 72 ,916 09-30-2021, 09:36 PM
Last Post: cathelest
Sentora on Windows ANY NEW INSTALLER elmoutakaf 3 13 ,403 10-04-2020, 02:37 AM
Last Post: Gigamax

Forum Jump:


Users browsing this thread: 1 Guest(s)