Create registration form

You can share your Lua Scripts with everybody here.

Create registration form

Postby harmonia » Sun Aug 07, 2011 9:11 pm

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!
harmonia
 
posts 2
 
joined Sun Aug 07, 2011 9:02 pm

Re: Create registration form

Postby FTP » Mon Aug 08, 2011 3:10 pm

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));
?>
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Re: Create registration form

Postby harmonia » Tue Aug 09, 2011 3:57 pm

Thank you a lot. i'll reply if i got problem, beacause i'm new in Php and java.
harmonia
 
posts 2
 
joined Sun Aug 07, 2011 9:02 pm

Re: Create registration form

Postby FTP » Wed Aug 10, 2011 4:44 am

OK, just try it.
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Re: Create registration form

Postby taitIT » Mon Sep 12, 2011 4:01 pm

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;
taitIT
 
posts 1
 
joined Tue Apr 19, 2011 3:10 pm

Re: Create registration form

Postby sat2they » Wed Aug 22, 2012 5:57 am

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!
sat2they
 
posts 2
 
joined Wed Aug 22, 2012 5:54 am

Re: Create registration form

Postby FTP » Thu Aug 23, 2012 6:07 am

OK, it should be:

Code: Select all
{{"1month"}}
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Re: Create registration form

Postby sat2they » Thu Aug 23, 2012 8:05 am

Thanks A lot
it's worked ;)
sat2they
 
posts 2
 
joined Wed Aug 22, 2012 5:54 am


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron