{.comment| THIS FUNCTION PERTAINS TO BASIC FEATURE SETTINGS AJAX FUNCTION .}
{.if|{.=|{.^action.}|features.}|{:
{.if|{.and|{.!=|{.from table|features|FTP.}|1.}|{.=|{.postvar|FTP.}|true.}.}|{:{.^writedb|features|FTP|1.}{.^startftp.}:}.}
{.if|{.and|{.!=|{.from table|features|FTP.}|0.}|{.=|{.postvar|FTP.}|false.}.}|{:{.^writedb|features|FTP|0.}{.^stopftp.}:}.}
{.if|{.=|{.postvar|UPLOADS.}|true.}|{:{.^writedb|features|UPLOADS|1.}:}.}
{.if|{.=|{.postvar|UPLOADS.}|false.}|{:{.^writedb|features|UPLOADS|0.}:}.}
{.if|{.=|{.postvar|CONTACTFORM.}|true.}|{:{.^writedb|features|CONTACTFORM|1.}:}.}
{.if|{.=|{.postvar|CONTACTFORM.}|false.}|{:{.^writedb|features|CONTACTFORM|0.}:}.}
{.if|{.=|{.postvar|PUBLICUPLOAD.}|true.}|{:{.^writedb|features|PUBLICUPLOAD|1.}:}.}
{.if|{.=|{.postvar|PUBLICUPLOAD.}|false.}|{:{.^writedb|features|PUBLICUPLOAD|0.}:}.}
{.if|{.=|{.postvar|POPCOUNT.}|true.}|{:{.^writedb|features|POPCOUNT|1.}:}.}
{.if|{.=|{.postvar|POPCOUNT.}|false.}|{:{.^writedb|features|POPCOUNT|0.}:}.}
{.if|{.=|{.postvar|NEWACCOUNTS.}|true.}|{:{.^writedb|features|NEWACCOUNTS|1.}:}.}
{.if|{.=|{.postvar|NEWACCOUNTS.}|false.}|{:{.^writedb|features|NEWACCOUNTS|0.}:}.}
{.if|{.=|{.postvar|FILEDELETE.}|true.}|{:{.^writedb|features|FILEDELETE|1.}:}.}
{.if|{.=|{.postvar|FILEDELETE.}|false.}|{:{.^writedb|features|FILEDELETE|0.}:}.}
{.if|{.=|{.postvar|NEWACCTVALIDATION.}|true.}|{:{.^writedb|features|NEWACCTVALIDATION|1.}:}.}
{.if|{.=|{.postvar|NEWACCTVALIDATION.}|false.}|{:{.^writedb|features|NEWACCTVALIDATION|0.}:}.}
{.if|{.=|{.postvar|MULTIPLEACCTPROTECT.}|true.}|{:{.^writedb|features|MULTIPLEACCTPROTECT|1.}:}.}
{.if|{.=|{.postvar|MULTIPLEACCTPROTECT.}|false.}|{:{.^writedb|features|MULTIPLEACCTPROTECT|0.}:}.}
{.if|{.=|{.postvar|NEWFOLDERS.}|true.}|{:{.^writedb|features|NEWFOLDERS|1.}:}.}
{.if|{.=|{.postvar|NEWFOLDERS.}|false.}|{:{.^writedb|features|NEWFOLDERS|0.}:}.}
{.if|{.=|{.postvar|PREFERENCES.}|true.}|{:{.^writedb|features|PREFERENCES|1.}:}.}
{.if|{.=|{.postvar|PREFERENCES.}|false.}|{:{.^writedb|features|PREFERENCES|0.}:}.}
{.if|{.=|{.postvar|DEFAULTFOLDERS.}|true.}|{:{.^writedb|features|DEFAULTFOLDERS|1.}:}.}
{.if|{.=|{.postvar|DEFAULTFOLDERS.}|false.}|{:{.^writedb|features|DEFAULTFOLDERS|0.}:}.}
{.if|{.=|{.postvar|LOCATION.}|true.}|{:{.^writedb|features|LOCATION|1.}:}.}
{.if|{.=|{.postvar|LOCATION.}|false.}|{:{.^writedb|features|LOCATION|0.}:}.}
{.if|{.=|{.postvar|FOLDERSHARING.}|true.}|{:{.^writedb|features|FOLDERSHARING|1.}:}.}
{.if|{.=|{.postvar|FOLDERSHARING.}|false.}|{:{.^writedb|features|FOLDERSHARING|0.}:}.}
{.if|{.=|{.postvar|PERMANENTDELETE.}|true.}|{:{.^writedb|features|PERMANENTDELETE|1.}:}.}
{.if|{.=|{.postvar|PERMANENTDELETE.}|false.}|{:{.^writedb|features|PERMANENTDELETE|0.}:}.}
{.if|{.=|{.postvar|SHARINGTOOLSEMAIL.}|true.}|{:{.^writedb|features|SHARINGTOOLSEMAIL|1.}:}.}
{.if|{.=|{.postvar|SHARINGTOOLSEMAIL.}|false.}|{:{.^writedb|features|SHARINGTOOLSEMAIL|0.}:}.}
{.if|{.=|{.postvar|PASSWORDCHANGE.}|true.}|{:{.^writedb|features|PASSWORDCHANGE|1.}:}.}
{.if|{.=|{.postvar|PASSWORDCHANGE.}|false.}|{:{.^writedb|features|PASSWORDCHANGE|0.}:}.}
{.if|{.=|{.postvar|PASSWORDRESET.}|true.}|{:{.^writedb|features|PASSWORDRESET|1.}:}.}
{.if|{.=|{.postvar|PASSWORDRESET.}|false.}|{:{.^writedb|features|PASSWORDRESET|0.}:}.}
{.if|{.=|{.postvar|STREAMING.}|true.}|{:{.^writedb|features|STREAMING|1.}:}.}
{.if|{.=|{.postvar|STREAMING.}|false.}|{:{.^writedb|features|STREAMING|0.}:}.}
{.if|{.=|{.postvar|FOLDERINFO.}|true.}|{:{.^writedb|features|FOLDERINFO|1.}:}.}
{.if|{.=|{.postvar|FOLDERINFO.}|false.}|{:{.^writedb|features|FOLDERINFO|0.}:}.}
{.if|{.=|{.postvar|NEWACCTMISC.}|true.}|{:{.^writedb|features|NEWACCTMISC|1.}:}.}
{.if|{.=|{.postvar|NEWACCTMISC.}|false.}|{:{.^writedb|features|NEWACCTMISC|0.}:}.}
{.if|{.=|{.postvar|RANDOMURLS.}|true.}|{:{.^writedb|features|RANDOMURLS|1.}:}.}
{.if|{.=|{.postvar|RANDOMURLS.}|false.}|{:{.^writedb|features|RANDOMURLS|0.}:}.}
{.if|{.=|{.postvar|HASHCALC.}|true.}|{:{.^writedb|features|HASHCALC|1.}:}.}
{.if|{.=|{.postvar|HASHCALC.}|false.}|{:{.^writedb|features|HASHCALC|0.}:}.}
{.if|{.=|{.postvar|COMMENTHTML.}|true.}|{:{.^writedb|features|COMMENTHTML|1.}:}.}
{.if|{.=|{.postvar|COMMENTHTML.}|false.}|{:{.^writedb|features|COMMENTHTML|0.}:}.}
Basic Feature Settings Saved Successfully.
:}.}
{.comment| THIS IS PERTAINING TO AJAX FUNCTION FOR INSTALL SETTINGS .}
{.if|{.=|{.^action.}|install.}|{:
{.^writedb|features|MAINCOLOR|{.postvar|maincolor.}|true.}
{.if|{.postvar|storagelimit.}|{:{.^writedb|installvars|STORAGELIMIT|{.replace|GB||{.postvar|STORAGELIMIT.}.}GB.}:}.}
{.if|{.postvar|sessiontimeout.}|{:{.^writedb|features|SESSIONTIMEOUT|{.postvar|SESSIONTIMEOUT.}.}:}.}
{.if|{.postvar|webtitle.}|{:{.^setftp|Initial Welcome Message|string|Welcome to FTP on {.postvar|webtitle.}!.}:}|{:{.^setftp|Initial Welcome Message|string|Welcome to FTP on {.if|{.postvar|webdomain.}|{.postvar|webdomain.}|{.^external-ip.}.}.}:}.}
{.^writedb|installvars|WEBTITLE|{.postvar|webtitle.}|true.}
{.^writedb|installvars|WEBDOMAIN|{.if|{.!=|{.postvar|webdomain.}|{.substring||:|{.^external-ip.}.}.}.}
{.if|{.and|{.postvar|httpport.}|{.!=|{.postvar|httpport.}|{.from table|installvars|HTTPPORT.}.}.}|{:
{.^writedb|installvars|EXTERNAL-IP|{.replace|:{.from table|installvars|httpport.}|:{.postvar|httpport.}|{.^external-ip.}.}.}
{.^writedb|installvars|HTTPPORT|{.postvar|httpport.}.}
{.set ini|port={.postvar|httpport.}.}
{.set|restartneeded|1.}
:}.}
{.if|{.and|{.postvar|sslport.}|{.!=|{.postvar|sslport.}|{.from table|installvars|SSLPORT.}.}.}|{:
{.^writedb|installvars|SSLPORT|{.postvar|sslport.}.}
{.set|restartneeded|1.}
:}.}
{.if|{.and|{.postvar|ftpport.}|{.!=|{.postvar|ftpport.}|{.^getftp|Serverports|string.}.}{.!=|{.postvar|ftpport.}|{.from table|installvars|FTPPORT.}.}.}|{:
{.^writedb|installvars|FTPPORT|{.postvar|ftpport.}.}
{.^setftp|Serverports|string|{.postvar|ftpport.}.}
:}.}
{.if|{.and|{.postvar|ftpsslport.}|{.!=|{.postvar|ftpsslport.}|{.^getftp|Implicit SSL ports|string.}.}{.!=|{.postvar|ftpsslport.}|{.from table|installvars|FTPSSLPORT.}.}.}|{:
{.^writedb|installvars|FTPSSLPORT|{.postvar|ftpsslport.}.}
{.^setftp|Implicit SSL ports|string|{.postvar|ftpsslport.}.}
:}.}
{.if|{.and|{.exists|sslcertificate.crt.}|{.postvar|ssl.}|{.!=|{.from table|features|SSL.}|{.replace|zero|0|{.replace|one|1|{.replace|two|2|{.postvar|ssl.}.}.}.}.}.}|{:
{.if not|{.and|{.=|{.postvar|ssl.}|one.}|{.=|{.from table|features|SSL.}|2.}.}{.and|{.=|{.postvar|ssl.}|two.}|{.=|{.from table|features|SSL.}|1.}.}|{:{.set|restartssl|1.}:}.}
{.if|{.{.postvar|ssl.} = zero.}|{: {.^writedb|features|SSL|0.}{.^setftp|Enable SSL|numeric|0.}{.^setftp|Allow explicit SSL|numeric|0.} {.for each|ftpuser|{.replace|;|{.no pipe||.}|{.load|C:\program files\FHFS\ftpconfig\[USERS].conf.}.}|{:{.if|{.^ftpuser.}|{:{.save|C:\program files\FHFS\ftpconfig\{.^ftpuser.}.xml|{.replace|||{.load|C:\program files\FHFS\ftpconfig\{.^ftpuser.}.xml.}.}.}:}.}:}.} :}.}
{.if|{.{.postvar|ssl.} = one.}|{: {.^writedb|features|SSL|1.}{.^setftp|Enable SSL|numeric|1.}{.^setftp|Allow explicit SSL|numeric|1.} {.for each|ftpuser|{.replace|;|{.no pipe||.}|{.load|C:\program files\FHFS\ftpconfig\[USERS].conf.}.}|{:{.if|{.^ftpuser.}|{:{.save|C:\program files\FHFS\ftpconfig\{.^ftpuser.}.xml|{.replace|||{.load|C:\program files\FHFS\ftpconfig\{.^ftpuser.}.xml.}.}.}:}.}:}.} :}.}
{.if|{.{.postvar|ssl.} = two.}|{: {.^writedb|features|SSL|2.}{.^setftp|Enable SSL|numeric|1.}{.^setftp|Allow explicit SSL|numeric|1.} {.for each|ftpuser|{.replace|;|{.no pipe||.}|{.load|C:\program files\FHFS\ftpconfig\[USERS].conf.}.}|{:{.if|{.^ftpuser.}|{:{.save|C:\program files\FHFS\ftpconfig\{.^ftpuser.}.xml|{.replace|||{.load|C:\program files\FHFS\ftpconfig\{.^ftpuser.}.xml.}.}.}:}.}:}.} :}.}
{.if|{.^restartssl.}|{:{.^stopstunnel.}{.load|stunnel.tpl.}:}.}
:}.}
{.$rebuildftp.}{.^resetftp.}
{.if|{.^restartneeded.}|{:{.^restart.}:}.}
:}.}
{.comment| THIS IS PERTAINING TO AJAX FUNCTION FOR EMAIL SETTINGS .}
{.if|{.{.^action.} = setemail.}|{:
{.if|{.postvar|fname.}|{:{.^writedb|installvars|EMAIL-FROM|{.postvar|fname.}.}:}.}
{.if|{.postvar|faddr.}|{:{.^writedb|installvars|EMAIL-FROM-ADDRESS|{.postvar|faddr.}.}:}.}
{.^writedb|installvars|EMAIL-BCCTO-ADDRESS|{.postvar|bcc.}.}
{.if|{.postvar|user.}|{:{.^writedb|installvars|EMAIL-SMTP-USER|{.postvar|user.}.}:}.}
{.if|{.and|{.postvar|pass.}|{.!=|{.postvar|pass.}|{.repeat|{.length|{.from table|installvars|EMAIL-SMTP-PASSWORD.}.}|..}.}.}|{:{.^writedb|installvars|EMAIL-SMTP-PASSWORD|{.postvar|pass.}.}:}.}
{.if|{.and|{.=|{.postvar|ssl.}|true.}|{.postvar|host.}|{.!=|{.from table|installvars|EMAIL-HOSTNAME.}|localhost:4650.}{.!=|{.from table|installvars|EMAIL-HOSTNAME-ACTUAL.}|{.postvar|host.}.}|{.exists|sslcertificate.crt.}.}|{:
do this if host is filled, ssl is true, and hostname is not set for ssl or hostname-actual is not equal to post
{.^writedb|installvars|EMAIL-HOSTNAME|localhost:4650.}
{.^writedb|installvars|EMAIL-HOSTNAME-ACTUAL|{.postvar|host.}.}
{.^stopstunnel.}{.load|stunnel.tpl.}
:}.}
{.if|{.and|{.=|{.postvar|ssl.}|false.}|{.postvar|host.}|{.!=|{.from table|installvars|EMAIL-HOSTNAME.}|{.postvar|host.}.}.}|{:
do this if host is filled, ssl is false, and hostname is set for ssl
{.^writedb|installvars|EMAIL-HOSTNAME|{.postvar|host.}.}
{.^writedb|installvars|EMAIL-HOSTNAME-ACTUAL||true.}
{.^stopstunnel.}{.load|stunnel.tpl.}
:}.}
:}.}
{.if|{.{.^action.} = sendemail.}|{:
{.save|C:\program files\FHFS\sentemails\admintest.html|test.}
{.^sendmail|FHFS Administrator|{.if|{.from table|installvars|adminemail.}|{:{.from table|installvars|adminemail.}:}|{:{.from table|installvars|EMAIL-FROM-ADDRESS.}:}.}|Email Test|admintest.html.}
{.if|{.^emailout.}|{:{.^emailout.}:}|{: 500 Unknown Error - No Response Received from SendEmail (Timeout or Crash). Is your Hostname correct? :}.}
:}.}
{.comment| THESE ARE PERTAINING TO AJAX FUNCTIONS FOR BASIC FZ/HFS SETUP .}
{.if|{.=|{.^action.}|sethfs.}|{:
{.if|{.postvar|defaults.}|{:
{.set ini|persistent-connections=yes.}
{.set ini|compressed-browsing=yes.}
{.set ini|delete-partial-uploads=yes.}
{.set ini|number-files-on-upload=yes.}
{.set ini|use-system-icons=yes.}
{.set ini|recursive-listing=no.}
{.set ini|default-sorting=ext.}
{.set ini|speed-limit=-1.}
{.set ini|speed-limit-ip=-1.}
{.set ini|max-ips=0.}
{.set ini|max-ips-downloading=0.}
{.set ini|max-connections=0.}
{.set ini|max-connections-by-ip=0.}
{.set ini|connections-timeout=60.}
{.set ini|max-contemporary-dls=0.}
{.set ini|max-contemporary-dls-ip=0.}
{.set ini|log-apache-format=%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\".}
HFS Configuration Reset to Default Values. Reloading Page...
:}|{:
{.if|{.=|{.postvar|persistent.}|true.}|{:{.set ini|persistent-connections=yes.}:}.}
{.if|{.=|{.postvar|persistent.}|false.}|{:{.set ini|persistent-connections=no.}:}.}
{.if|{.=|{.postvar|compress.}|true.}|{:{.set ini|compressed-browsing=yes.}:}.}
{.if|{.=|{.postvar|compress.}|false.}|{:{.set ini|compressed-browsing=no.}:}.}
{.if|{.=|{.postvar|delpartial.}|true.}|{:{.set ini|delete-partial-uploads=yes.}:}.}
{.if|{.=|{.postvar|delpartial.}|false.}|{:{.set ini|delete-partial-uploads=no.}:}.}
{.if|{.=|{.postvar|numduplicates.}|true.}|{:{.set ini|number-files-on-upload=yes.}:}.}
{.if|{.=|{.postvar|numduplicates.}|false.}|{:{.set ini|number-files-on-upload=no.}:}.}
{.if|{.=|{.postvar|sysicons.}|true.}|{:{.set ini|use-system-icons=yes.}:}.}
{.if|{.=|{.postvar|sysicons.}|false.}|{:{.set ini|use-system-icons=no.}:}.}
{.if|{.=|{.postvar|recursive.}|true.}|{:{.set ini|recursive-listing=yes.}:}.}
{.if|{.=|{.postvar|recursive.}|false.}|{:{.set ini|recursive-listing=no.}:}.}
{.if|{.postvar|sorting.}|{:{.set ini|default-sorting={.postvar|sorting.}.}:}.}
{.if|{.=|{.postvar|lim1.}|0.}|{:{.set ini|speed-limit=-1.}:}|{:{.if|{.postvar|lim1.}|{:{.set ini|speed-limit={.postvar|lim1.}.}:}.}:}.}
{.if|{.=|{.postvar|lim2.}|0.}|{:{.set ini|speed-limit-ip=-1.}:}|{:{.if|{.postvar|lim2.}|{:{.set ini|speed-limit-ip={.postvar|lim2.}.}:}.}:}.}
{.set ini|max-ips={.postvar|lim3.}.}
{.set ini|max-ips-downloading={.postvar|lim4.}.}
{.set ini|max-connections={.postvar|lim5.}.}
{.set ini|max-connections-by-ip={.postvar|lim6.}.}
{.set ini|connections-timeout={.postvar|lim7.}.}
{.set ini|max-contemporary-dls={.postvar|lim8.}.}
{.set ini|max-contemporary-dls-ip={.postvar|lim9.}.}
{.if|{.postvar|logformat.}|{:{.set ini|log-apache-format={.postvar|logformat.}.}:}.}
HFS Configuration Saved and Reloaded Successfully.
:}.}
:}.}
{.if|{.=|{.^action.}|setfz.}|{:
{.if|{.postvar|defaults.}|{:
{.^setftp|Number of Threads|numeric|2.}
{.^setftp|Maximum user count|numeric|20.}
{.^setftp|Timeout|numeric|300.}
{.^setftp|No Transfer Timeout|numeric|300.}
{.^setftp|Login Timeout|numeric|30.}
{.^setftp|Download Speedlimit Type|numeric|0.}{.^setftp|Download Speedlimit|numeric|0.}
{.^setftp|Upload Speedlimit Type|numeric|0.}{.^setftp|Upload Speedlimit|numeric|0.}
{.^setftp|Buffer Size|numeric|32768.}
{.^setftp|Network Buffer Size|numeric|65536.}
{.^setftp|Autoban attempts|numeric|8.}
{.^setftp|Autoban time|numeric|1.}
{.^setftp|Mode Z Use|numeric|1.}
FTP Configuration Reset to Default Values. Reloading Page...
:}|{:
{.if|{.>|{.postvar|threads.}|0.}|{:{.^setftp|Number of Threads|numeric|{.postvar|threads.}.}:}.}
{.^setftp|Maximum user count|numeric|{.postvar|maxusers.}.}
{.^setftp|Timeout|numeric|{.postvar|timeout.}.}
{.^setftp|No Transfer Timeout|numeric|{.postvar|nttimeout.}.}
{.^setftp|Login Timeout|numeric|{.postvar|litimeout.}.}
{.if|{.=|{.postvar|dllimit.}|0.}|{:{.^setftp|Download Speedlimit Type|numeric|0.}{.^setftp|Download Speedlimit|numeric|0.}:}|{:{.^setftp|Download Speedlimit Type|numeric|1.}{.^setftp|Download Speedlimit|numeric|{.postvar|dllimit.}.}:}.}
{.if|{.=|{.postvar|ullimit.}|0.}|{:{.^setftp|Upload Speedlimit Type|numeric|0.}{.^setftp|Upload Speedlimit|numeric|0.}:}|{:{.^setftp|Upload Speedlimit Type|numeric|1.}{.^setftp|Upload Speedlimit|numeric|{.postvar|ullimit.}.}:}.}
{.if|{.>|{.postvar|ibuffer.}|512.}|{:{.^setftp|Buffer Size|numeric|{.postvar|ibuffer.}.}:}.}
{.if|{.>|{.postvar|nbuffer.}|512.}|{:{.^setftp|Network Buffer Size|numeric|{.postvar|nbuffer.}.}:}.}
{.if|{.!=|{.postvar|banattempts.}|0.}|{:{.^setftp|Autoban attempts|numeric|{.postvar|banattempts.}.}:}.}
{.if|{.!=|{.postvar|bantime.}|0.}|{:{.^setftp|Autoban time|numeric|{.postvar|bantime.}.}:}.}
{.if|{.^boolean|{.postvar|compress.}.}|{:{.^setftp|Mode Z Use|numeric|1.}:}|{:{.^setftp|Mode Z Use|numeric|0.}:}.}
FTP Configuration Saved and Reloaded Successfully.
:}.}
{.$rebuildftp.}{.^reloadftp.}
:}.}
{.comment| THESE ARE PERTAINING TO AJAX FUNCTIONS FOR THE USER DATABASE TABLE .}
{.if|{.=|{.^action.}|accounts_logoffall.}|{:
{.for each|account|{.replace|;|{.no pipe||.}|{.^getaccounts.}.}|{:
{.if|{.!=|{.^account.}|{.from table|installvars|admin.}.}|{:
{.^notes|{.^account.}|sessionID||true.}
:}.}:}.} All user session-IDs have been erased. :}.}
{.if|{.=|{.^action.}|accounts_resetallpasses.}|{: {.set|thetime|{.time|mm.}{.time|dd.}{.time|yy.}-{.time|hh.}{.time|mm.}{.time|ss.}.}
{.for each|account|{.replace|;|{.no pipe||.}|{.^getaccounts.}.}|{:
{.if|{.!=|{.^account.}|{.from table|installvars|admin.}.}|{:
{.^notes|{.^account.}|question1||true.}{.^notes|{.^account.}|question2||true.}{.^notes|{.^account.}|answer1||true.}{.^notes|{.^account.}|answer2||true.}{.^notes|{.^account.}|securitytype||true.}{.^notes|{.^account.}|sessionid||true.}
{.set|randomcharacters|128.}{.set|salt|{.load|random.tpl.}.}{.set|randomcharacters|5.}{.set|password|{.load|random.tpl.}.}{.append|{.from table|installvars|homedir.}\desktop\fhfs_new_passwords_{.^thetime.}.txt|{.^account.} -- {.^data|user2email|{.^account.}.} == {.^password.}{.^br.}.}
{.^notes|{.^account.}|salt|{.^salt.}.}{.^notes|{.^account.}|password|{.trim|{.^php|whirlpoolhash|{.^password.} {.^notes|{.^account.}|salt.} {.^account.}.}.}.}
:}.}:}.} All passwords for every account but your own have been reset. :}.}
{.if|{.{.^action.} = accounts_newaccount.}|{:{.if|{.and|{.postvar|user.}|{.postvar|email.}|{.postvar|password.}.}|{:
{.if|{.and|{.not|{.get account|{.postvar|user.}|exists.}.}|{.not|{.^data|user2email|{.postvar|email.}.}.}.}|{: Account Created Successfully.
{.^account-create|{.postvar|user.}|{.postvar|email.}|{.postvar|password.}.}{.set account|{.postvar|user.}|enabled=1.}
:}|{: 400 - An account already exists with that name or email :}.}
:}|{: 400 - You Must Input Every Field. :}.}:}.}
{.if|{.=|{.^action.}|accounts_import.}|{:{.if|{.and|{.is file|{.from table|installvars|homedir.}\desktop\{.postvar|file.}.}|{.postvar|file.}.}|{:
{.load|{.from table|installvars|homedir.}\desktop\{.postvar|file.}|var=import.}
{.if|{.count substring|.###backup###|.{.^import.}.}|{:{.set|mode|backup.}:}.}
{.if|{.{.^mode.} = backup.}|{:
{.set|data-hash|{.cut|0|129|what={.replace|###backup###||{.^import.}.}.}.}
{.set|data-decoded|{.^php| echo base64_decode('{.replace|###backup###{.^data-hash.}||{.^import.}.}'); .}.}
{.if|{.=|{.^data-hash.}|{.^php| echo hash('whirlpool', '{.^data-decoded.}');.}.}|{:
Accounts Backup Restored Successfully in %build-time% seconds.
{.for each|account|{.replace|;;;;;;;;|{.no pipe||.}|{.^data-decoded.}.}|{:{.if|{.^account.}|{:
{.set|account-username|{.substring||=1=|{.^account.}|include=1.}.}{.set|account-enabled|{.substring|=1=|=2=|{.^account.}|include=0.}.}{.set|account-redirect|{.substring|=2=|=3=|{.^account.}|include=0.}.}{.set|account-email|{.substring|=3=|=4=|{.^account.}|include=0.}.}{.set|account-notes|{.substring|=4=||{.^account.}|include=2.}.}
{.new account|{.^account-username.}.}{.set account|{.^account-username.}|redirect={.^account-redirect.}|enabled={.^account-enabled.}|notes=.}
{.for each|note|{.replace|::|{.no pipe||.}|{.^account-notes.}.}|{:{.^notes|{.^account-username.}|{.substring||=|{.^note.}.}|{.substring|=||{.^note.}|include=0.}.}:}.}
{.^data|user2email|{.^account-username.}|{.^account-email.}.}{.^data|user2email|{.^account-email.}|{.^account-username.}.}
{.mkdir|{.from table|installvars|CONTENTDIR.}\content-users\{.upper|{.^account-username.}.}.}{.mkdir|{.from table|installvars|CONTENTDIR.}\content-users\{.upper|{.^account-username.}.}\shared.}{.mkdir|{.from table|installvars|CONTENTDIR.}\content-users\{.upper|{.^account-username.}.}\private.}
:}.}:}.}
{.$rebuildvfs.}
:}|{: 500 - It Appears That the Backup File is Corrupted... :}.}
:}|{:
Account File Loaded in %build-time% seconds.
{.for each|account|{.replace|;;|{.no pipe||.}|{.^import.}.}|{:
{.set|account-username|{.trim|{.substring||;|{.^account.}|include=0.}.}.}
{.set|account-email|{.trim|{.substring||;|{.replace|{.^account-username.};||{.^account.}.}|include=0.}.}.}
{.set|account-password|{.trim|{.substring||;|{.replace|{.^account-username.};{.^account-email.};||{.^account.}.}|include=0.}.}.}
{.if|{.and|{.^account-username.}|{.^account-email.}|{.^account-password.}|{.not|{.get account|{.^account-username.}|exists.}.}|{.not|{.^data|user2email|{.^account-email.}.}.}.}|{:
{.^account-create|{.^account-username.}|{.^account-email.}|{.^account-password.}.}{.set account|{.^account-username.}|enabled=1.}
:}.}
:}.}
:}.}
:}|{: 400 - Couldn't find the file you specified. :}.}:}.}
{.if|{.=|{.^action.}|accounts_export.}|{: {.set|thetime|{.time|yyyy.}{.time|mm.}{.time|dd.}-{.time|hh.}{.time|mm.}{.time|ss.}.}
{.for each|account|{.replace|;|{.no pipe||.}|{.^getaccounts|true.}.}|{:
{.set|output|{.^account.}=1={.replace|1|enabled|{.get account|{.^account.}|enabled.}.}=2={.get account|{.^account.}|redirect.}=3={.^data|user2email|{.^account.}.}=4={.replace|{.decodeuri|%0A.}|:|{.decodeuri|%0D.}|:|{.get account|{.^account.}|notes.}.};;;;;;;;|mode=append.}
:}.} {.save|{.^tempdir.}\accounts_export.tmp.php| .}{.save|{.from table|installvars|homedir.}\desktop\fhfs_accounts_backup_{.^thetime.}.dat|###backup###{.^php|include '{.^tempdir.}\accounts_export.tmp.php';.}.}{.delete|{.^tempdir.}\accounts_export.tmp.php|bin=0.}
Backup Successful in %build-time% seconds. :}.}
{.if|{.=|{.^action.}|accounts_resetpassword.}|{:
{.^notes|{.postvar|account.}|question1||true.}{.^notes|{.postvar|account.}|question2||true.}{.^notes|{.postvar|account.}|answer1||true.}{.^notes|{.postvar|account.}|answer2||true.}{.^notes|{.postvar|account.}|securitytype||true.}{.^notes|{.postvar|account.}|sessionid||true.}
{.set|randomcharacters|128.}{.set|salt|{.load|random.tpl.}.}{.set|randomcharacters|5.}{.set|password|{.load|random.tpl.}.}{.^notes|{.postvar|account.}|salt|{.^salt.}.}{.^notes|{.postvar|account.}|password|{.trim|{.^php|whirlpoolhash|{.^password.} {.^notes|{.postvar|account.}|salt.} {.postvar|account.}.}.}.}
{.postvar|account.}'s new password is: {.^password.} (ALL CAPS!)
Don't forget to copy this down!
:}.}
{.if|{.=|{.^action.}|accounts_disable.}|{:
{.set account|{.postvar|account.}|enabled={.postvar|action.}.}
{.if|{.=|{.postvar|action.}|0.}|{:
{.^notes|{.postvar|account.}|sessionID||true.}
{.if|{.^boolean|{.postvar|delftp.}.}|{:{.^removeftp|{.postvar|account.}.}{.$rebuildftp.}{.^reloadftp.}:}.}
:}.}
{.if|{.=|{.postvar|action.}|1.}|{:
{.if|{.^notes|{.postvar|account.}|validation.}|{:
{.^data|validation|{.^notes|{.postvar|account.}|validation.}-user||true.}
{.^data|validation|{.^notes|{.postvar|account.}|validation.}-code||true.}
{.^notes|{.^account.}|validation||true.}
:}.}:}.} Account {.if|{.=|{.postvar|action.}|1.}|Enabled|{.if|{.^boolean|{.postvar|delftp.}.}|and FTP.} Disabled.} Successfully :}.}
{.if|{.=|{.^action.}|accounts_delete.}|{:{.if|{.get account|{.postvar|account.}|exists.}|{:
{.if|{.^boolean|{.postvar|deleteall.}.}|{:{.set|deletefiles|true.}:}.}
{.^account-delete|{.postvar|account.}|{.^deletefiles.}|false.}
{.postvar|account.}'s account {.if|{.^deletefiles.}|and all of its files have|has.} been deleted permanently.:}.}:}.}
{.if|{.=|{.^action.}|accounts_openfolder.}|{:
{.exec|C:\windows\explorer.exe "{.from table|installvars|CONTENTDIR.}\content-users\{.^nopathchange|{.postvar|account.}.}".}
Folder Opened on Host Machine.
:}.}
{.if|{.=|{.^action.}|accounts_editlimit.}|{:{.if|{.postvar|account.}|{:
{.if|{.postvar|newlimit.}|{:{.^notes|{.postvar|account.}|maxsize|{.postvar|newlimit.}GB.}:}|{:{.^notes|{.postvar|account.}|maxsize||true.}:}.}
Account Size Limit {.if|{.postvar|newlimit.}|Set|Removed.} Successfully.
:}.}:}.}
{.comment| THESE ARE PERTAINING TO AJAX FUNCTIONS FOR THE TOOLS FIELDSET .}
{.if|{.=|{.^action.}|tools_1.}|{:
{.set|startdata|{.trim|{.substring||&end|{.load|http://startup.fhfs.tk/startup.php.}|include=1+2.}.}.}{.set|v1|{.trim|{.substring|&3=|&end|{.^startdata.}|include=0.}.}.}
{.if|{.!=|{.^version.} {.load|pre.dat.}|{.^v1.}.}|{: An Update from {.^version.} {.load|pre.dat.} to {.^v1.} is possible! {.notify|An Update from {.^version.} {.load|pre.dat.} to {.^v1.} is possible!|title=Server Start|timeout=30|type=info.}:}|{: FHFS {.^version.} {.load|pre.dat.} is up to date! {.notify|FHFS {.^version.} {.load|pre.dat.} is up to date!|title=Server Start|timeout=5|type=info.}:}.}
:}.}
{.if|{.=|{.^action.}|tools_2.}|{:
{.if not|{.and|{.postvar|sslcountry.}|{.postvar|sslstate.}|{.postvar|sslcity.}|{.postvar|ssladdr.}|{.postvar|sslorg.}.}{.not|{.postvar|sslcountry.}{.postvar|sslstate.}{.postvar|sslcity.}{.postvar|ssladdr.}{.postvar|sslorg.}.}|{:{.set|sslerr1|true.} You cannot fill in some SSL certificate values and leave others blank.
Either enter every value manually, or leave them all blank. :}.}
{.if|{.and|{.postvar|sslcountry.}|{.!=|{.length|{.postvar|sslcountry.}.}|2.}.}|{:{.set|sslerr2|true.} You entered an invalid country code. It must be 2 characters in length! :}.}
{.if not|{.^sslerr1.}{.^sslerr2.}|{:
{.set|geobytes|{.load|http://www.geobytes.com/IpLocator.htm?GetLocation&template=php3.txt.}.}
{.set|randomcharacters|16.}
{.if|{.postvar|sslcountry.}|{:{.set|sslcountry|{.postvar|sslcountry.}.}:}|{:{.set|sslcountry|{.substring||{.^geobytes.}|include=0.}.}:}.}
{.if|{.postvar|sslstate.}|{:{.set|sslstate|{.postvar|sslstate.}.}:}|{:{.set|sslstate|{.substring||{.^geobytes.}|include=0.}.}:}.}
{.if|{.postvar|sslcity.}|{:{.set|sslcity|{.postvar|sslcity.}.}:}|{:{.set|sslcity|{.substring||{.^geobytes.}|include=0.}.}:}.}
{.if|{.postvar|ssladdr.}|{:{.set|ssladdr|{.postvar|ssladdr.}.}:}|{:{.set|ssladdr|{.^domain.}.}:}.}
{.if|{.postvar|sslorg.}|{:{.set|sslorg|{.postvar|sslorg.}.}:}|{:{.set|sslorg|{.if|{.from table|installvars|webtitle.}|{:{.from table|installvars|webtitle.}:}|{:FHFS End-User Server - {.load|random.tpl.}:}.}.}:}.}
{.if not|{.and|{.^sslcountry.}|{.^sslstate.}|{.^sslcity.}|{.^ssladdr.}|{.^sslorg.}.}|{:{.set|sslerr3|true.} You must manually enter your SSL Information as we were unable to find all the correct values. :}.}
{.if not|{.^sslerr3.}|{:
{.^stopstunnel.}{.^stopftp.}{.delete|sslcertificate.crt.old.}{.rename|sslcertificate.crt|sslcertificate.crt.old.}
{.save|gencert.tmp.bat|@echo off
set OPENSSL_CONF=c:\program files\FHFS\openssl-bin\openssl.cfg
"C:\program files\FHFS\openssl-bin\openssl.exe" req -x509 -nodes -days 1826 -newkey rsa:4096 -keyout "C:\Program files\FHFS\sslcertificate.crt" -out "C:\Program files\FHFS\sslcertificate.crt" -subj "/C={.^sslcountry.}/ST={.^sslstate.}/L={.^sslcity.}/O={.^sslorg.}/OU=FHFS End-User Server/CN={.^ssladdr.}"
DEL "C:\program files\FHFS\*.rnd".}
{.exec|gencert.tmp.bat|out=null|timeout=120.}{.delete|gencert.tmp.bat.}
{.if|{.from table|features|FTP.}|{:{.^startftp.}:}.}{.load|stunnel.tpl.}
:}.} :}.} :}.}
{.if|{.=|{.^action.}|tools_5.}|{:
{.exec|C:\windows\explorer.exe "C:\program files\FHFS\logs\".}
Folder Opened on Host Machine.
:}.}
{.if|{.=|{.^action.}|tools_6.}|{:
{.exec|C:\windows\explorer.exe "{.from table|installvars|CONTENTDIR.}\content-shared\".}
Folder Opened on Host Machine.
:}.}
{.if|{.=|{.^action.}|tools_8.}|{:
{.$rebuildftp.}{.^resetftp.}
FTP XML Data Rebuilt Successfully. FileZilla Reset Successfully.
:}.}
{.if|{.=|{.^action.}|tools_10.}|{:
{.if|{.from table|installvars|MaintenanceMODE.}|{:{.^writedb|installvars|MaintenanceMODE||true.} Maintenance Mode Stopped. :}|{:{.^writedb|installvars|MaintenanceMODE|true.} FHFS is now in maintenance mode! Nobody but you can access the server.