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!
Create registration form
-
- Site Admin
- Posts: 2083
- Joined: Tue Sep 29, 2009 6:09 am
Re: Create registration form
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));
?>
-
- Posts: 2
- Joined: Sun Aug 07, 2011 9:02 pm
Re: Create registration form
Thank you a lot. i'll reply if i got problem, beacause i'm new in Php and java.
-
- Site Admin
- Posts: 2083
- Joined: Tue Sep 29, 2009 6:09 am
Re: Create registration form
OK, just try it.
-
- Posts: 1
- Joined: Tue Apr 19, 2011 3:10 pm
Re: Create registration form
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;
-
- Posts: 2
- Joined: Wed Aug 22, 2012 5:54 am
Re: Create registration form
How use table ?
iwant to add group for user
my code like this :
but group not add to user!
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')
-
- Site Admin
- Posts: 2083
- Joined: Tue Sep 29, 2009 6:09 am
Re: Create registration form
OK, it should be:
Code: Select all
{{"1month"}}
-
- Posts: 2
- Joined: Wed Aug 22, 2012 5:54 am
Re: Create registration form
Thanks A lot
it's worked ;)
it's worked ;)