Create registration form

You can share your Lua Scripts with everybody here.
Post Reply
harmonia
Posts: 2
Joined: Sun Aug 07, 2011 9:02 pm

Create registration form

Post by harmonia »

How can i make a registration form for permanent user accounts?
i have only find how to create a temp. account.
but in my case i need permanent.
for example: the main screen has the login form and button. is it possible to make a "register" button in the same window?

Thanks!
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Create registration form

Post by FTP »

Yes, you can write a registration page by PHP (or Java), then you can call the Lua webservice for adding user account, like this:

Code: Select all

<?php 
$strUrl = "http://127.0.0.1:5466/admin_webservice.html";
$strUrlParam = '?admin=demo&pass=12345&cmd=';	//admin user/pass
$domain = "demo";			//which domain for storing accout
$username = $_REQUEST['username'];	//account name
$password = $_REQUEST['password'];	//account password
$homedir = $_REQUEST['homedir']; //home directory, like D:/temp

//Note: the content of variable $strLuaScript is Lua scripts
$strLuaScript = <<<EOT
c_AddUser('".$domain."','".$username."',md5('".$password."'),63,1,1)
c_AddUserDirectory('".$domain."','".$username."','".$homedir."','/',true,true,false,false,false,true,false,false,false,false,false,false)
EOT;

file_get_contents($strUrl.$strUrlParam.rawurlencode($strLuaScript));
?>
harmonia
Posts: 2
Joined: Sun Aug 07, 2011 9:02 pm

Re: Create registration form

Post by harmonia »

Thank you a lot. i'll reply if i got problem, beacause i'm new in Php and java.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Create registration form

Post by FTP »

OK, just try it.
taitIT
Posts: 1
Joined: Tue Apr 19, 2011 3:10 pm

Re: Create registration form

Post by taitIT »

Yeah so that example doesn't work for me. I had to remove all the double quotes (") and periods (.), which were being inserted literally into the string. This definitely doesn't make sense to me, but it works, so if anyone has any idea what I'm doing differently please let me know.

Code: Select all

$strCreateAccountLuaScript = <<<EOT
c_AddUser('$strDomain','$strUserName',md5('$strPassword'),63,1,1)c_AddUserDirectory('$strDomain','$strUserName','$strWindowsPath$strDirectory','/',true,true,true,true,true,true,true,true,true);
EOT;
sat2they
Posts: 2
Joined: Wed Aug 22, 2012 5:54 am

Re: Create registration form

Post by sat2they »

How use table ?
iwant to add group for user
my code like this :

Code: Select all

c_AddUser('$domain','$username',md5('$password'),63,1,1,'','','','','','','','','','','','','','','','','','','','','','123456','','test@gmail.com','','','','',{"1month"},'','','','','','','','','',1,'$date')
but group not add to user!
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Create registration form

Post by FTP »

OK, it should be:

Code: Select all

{{"1month"}}
sat2they
Posts: 2
Joined: Wed Aug 22, 2012 5:54 am

Re: Create registration form

Post by sat2they »

Thanks A lot
it's worked ;)
Post Reply