RESOLUTION
You can use the following PHP variables for clients session to determine locale and php session Id:
_REQUEST["locale"]
_REQUEST["PHPSESSID"]
And then you can determine a user skin with the help of mysql queries like:
1. select login from sessions where sess_id='<php_session_id>';
this query will show you the client's login name for current session.
2. select c.login, s.name, s.id from clients c, cl_param cl, Skins s where
cl.cl_id=c.id and cl.param='skin_id' and c.login='<user_name>' and
s.id=cl.val;
Where <user_name> is the client's login name for current session. This query will show you the user name, the skin name and the skin ID.
3. Also you can determine the locale with the query:
select locale from clients where login='<user_name>';
You can use mysql user 'admin' with the same password as for the control panel admin login. You can place all custom php scripts into admin's document root :
/usr/local/psa/admin/htdocs