Page 1 of 1

Create registration form

Posted: Sun Aug 07, 2011 9:11 pm
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!

Re: Create registration form

Posted: Mon Aug 08, 2011 3:10 pm
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));
?>

Re: Create registration form

Posted: Tue Aug 09, 2011 3:57 pm
by harmonia
Thank you a lot. i'll reply if i got problem, beacause i'm new in Php and java.

Re: Create registration form

Posted: Wed Aug 10, 2011 4:44 am
by FTP
OK, just try it.

Re: Create registration form

Posted: Mon Sep 12, 2011 4:01 pm
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;

Re: Create registration form

Posted: Wed Aug 22, 2012 5:57 am
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!

Re: Create registration form

Posted: Thu Aug 23, 2012 6:07 am
by FTP
OK, it should be:

Code: Select all

{{"1month"}}

Re: Create registration form

Posted: Thu Aug 23, 2012 8:05 am
by sat2they
Thanks A lot
it's worked ;)