diff options
Diffstat (limited to 'services/samba/system.esp')
-rw-r--r-- | services/samba/system.esp | 118 |
1 files changed, 0 insertions, 118 deletions
diff --git a/services/samba/system.esp b/services/samba/system.esp deleted file mode 100644 index 59844cda39..0000000000 --- a/services/samba/system.esp +++ /dev/null @@ -1,118 +0,0 @@ -<% -/* - * Copyright: - * (C) 2006 by Derrell Lipman - * All rights reserved - * - * License: - * LGPL 2.1: http://creativecommons.org/licenses/LGPL/2.1/ - */ - -/* - * JSON-RPC mappings to system facilities - */ - -/* We'll be accessing session resources */ -jsonrpc_include("resources.esp"); - - -/** - * Authenticate and log in - * - * @param params[0] - * User name - * - * @param params[1] - * Password - * - * @param params[2] - * Domain - * - * @param error - * An object of class JsonRpcError. - * - * @return - * Success: "Logged in" - * Failure: error event, origin=Server, code=LoginFailed - */ -function _login(params, error) -{ - var ret; - var creds = credentials_init(); - - creds.set_username(params[0]); - creds.set_password(params[1]); - creds.set_domain(params[2]); - creds.set_workstation(request['REMOTE_HOST']); - auth = userAuth(creds, request['REMOTE_SOCKET_ADDRESS']); - - if (auth == undefined) - { - error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server); - error.setError(jsonrpc.Constant.ServerError.LoginFailed, - "Invalid login."); - ret = error; - } - else if (auth.result) - { - session.AUTHENTICATED = true; - session.authinfo = new Object(); - - session.authinfo.username = auth.username; - session.authinfo.domain = auth.domain; - session.authinfo.credentials = creds; - session.authinfo.session_info = auth.session_info; - - ret = "Logged in"; - } - else if (auth.report == undefined) - { - error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server); - error.setError(jsonrpc.Constant.ServerError.LoginFailed, - "Login failed."); - ret = error; - } - else - { - error.setOrigin(jsonrpc.Constant.ErrorOrigin.Server); - error.setError(jsonrpc.Constant.ServerError.LoginFailed, - "Login failed: " + auth.report); - ret = error; - } - - return ret; -} -jsonrpc.method.login = _login; - - - -/** - * Retrieve the list of open resources (for debugging) - * - * @return "Logged out" - */ -function _logout(params, error) -{ - session.AUTHENTICATED = false; - return "Logged out"; -} -jsonrpc.method.logout = _logout; - - - -/** - * Retrieve the list of open resources (for debugging) - */ -function _get_open_resources(params, error) -{ - return session.resources.getList(error); -} -jsonrpc.method.get_open_resources = _get_open_resources; - - -/* - * Local Variables: - * mode: c - * End: - */ -%> |