22if (!defined(
'ALLOWED'))
23 die(
'Appel direct ne sont pas permis');
33if (
$g_user->check_module(
"CFGSEC") == 0)
34 throw new Exception(_(
"Non autorisé"));
40if (
$op==
"ledger_access")
44 $user_id=
$http->post(
"user_id",
"number");
45 $jrn_def_id=
$http->post(
"jrn_def_id",
"number");
49 $ie_input->set_callback(
"ajax_misc.php");
50 $ie_input->add_json_param(
"jrn_def_id", $jrn_def_id);
51 $ie_input->add_json_param(
"op",
"ledger_access");
53 $ie_input->add_json_param(
"user_id", $user_id);
54 echo $ie_input->ajax_input();
61 $ie_input->set_callback(
"ajax_misc.php");
62 $ie_input->add_json_param(
"jrn_def_id", $jrn_def_id);
63 $ie_input->add_json_param(
"op",
"ledger_access");
65 $ie_input->add_json_param(
"user_id", $user_id);
66 $ie_input->set_value(
$value);
68 $count=
$cn->get_value(
'select count(*) from user_sec_jrn where uj_login=$1 '.
69 ' and uj_jrn_id=$2', array($sec_User->login, $jrn_def_id));
72 $cn->exec_sql(
'insert into user_sec_jrn (uj_login,uj_jrn_id,uj_priv)'.
74 array($sec_User->login, $jrn_def_id,
$value));
78 $cn->exec_sql(
'update user_sec_jrn set uj_priv=$1 where uj_login=$2 and uj_jrn_id=$3',
79 array(
$value, $sec_User->login, $jrn_def_id));
81 echo $ie_input->value();
87 $ie_input->set_callback(
"ajax_misc.php");
88 $ie_input->add_json_param(
"jrn_def_id", $jrn_def_id);
89 $ie_input->add_json_param(
"op",
"ledger_access");
91 $ie_input->add_json_param(
"user_id", $user_id);
92 echo $ie_input->value();
102 $action=
$http->request(
"ieaction",
"string",
"display");
103 $user_id=
$http->post(
"user_id",
"number");
108 $ie_input->set_callback(
"ajax_misc.php");
109 $ie_input->add_json_param(
"profile_id",
$profile_id);
110 $ie_input->add_json_param(
"op",
"profile");
112 $ie_input->add_json_param(
"user_id", $user_id);
113 echo $ie_input->ajax_input();
122 $sec_User->save_profile(
$value);
125 $ie_input->set_callback(
"ajax_misc.php");
126 $ie_input->add_json_param(
"op",
"profile");
127 $ie_input->add_json_param(
"profile_id",
$profile_id);
129 $ie_input->add_json_param(
"user_id", $user_id);
130 $ie_input->set_value(
$value);
132 echo $ie_input->value();
138 $ie_input->set_callback(
"ajax_misc.php");
139 $ie_input->add_json_param(
"op",
"profile");
141 $ie_input->add_json_param(
"profile_id",
$profile_id);
142 $ie_input->add_json_param(
"user_id", $user_id);
143 echo $ie_input->value();
150if (
$op==
'ledger_access_all')
153 $user_id=
$http->post(
"user_id",
"number");
156 die(
"Invalid access");
159 $sql=
"insert into user_sec_jrn(
163 ) select jrn_def_id,$1,'X'
171 uj_jrn_id = jrn_def_id
174 $cn->exec_sql(
$sql, array($sec_User->login));
175 $cn->exec_sql(
'update user_sec_jrn set uj_priv=$1 where uj_login=$2',
176 array(
$access, $sec_User->login));
182if (
$op==
"action_access")
185 $user_id=
$http->get(
"user_id",
"number");
192 $cn->exec_sql(
"delete from user_sec_act where ua_act_id=$1 and ua_login=$2",
194 echo $is_switch->get_iconoff();
196 $cn->exec_sql(
'insert into user_sec_act (ua_login,ua_act_id)'.
199 echo $is_switch->get_iconon();
208if (
$op==
"action_access_all")
210 $user_id=
$http->get(
"user_id",
"number");
214 $cn->exec_sql(
"delete from user_sec_act where ua_login=$1",array($sec_User->login));
218 insert into user_sec_act(ua_login,ua_act_id) select $1,ac_id from action where not exists(select 1 from user_sec_act where ua_login=$1 and ua_act_id=ac_id)",
219 array($sec_User->login));
226if (
$op==
"user_sec_ledger")
228 $user_id=
$http->get(
"user_id",
"number");
231 $status_sec_ledger=$sec_user->get_status_security_ledger();
233 $sec_ledger->set_callback(
"ajax_misc.php");
235 $sec_ledger->add_json_param(
"user_id", $user_id);
236 $sec_ledger->add_json_param(
"op",
"user_sec_ledger");
237 if ($sec_user->get_status_security_ledger()==1||$sec_user->Admin()==1)
239 $sec_user->set_status_security_ledger(0);
240 echo $sec_ledger->get_iconoff();
242 $sec_user->set_status_security_ledger(1);
243 echo $sec_ledger->get_iconon();
250if (
$op==
"user_sec_action")
252 $user_id=
$http->get(
"user_id",
"number");
255 $status_sec_action=$sec_user->get_status_security_action();
257 $sec_action->set_callback(
"ajax_misc.php");
259 $sec_action->add_json_param(
"user_id", $user_id);
260 $sec_action->add_json_param(
"op",
"user_sec_action");
261 if ($sec_user->get_status_security_action()==1||$sec_user->Admin()==1)
263 $sec_user->set_status_security_action(0);
264 echo $sec_action->get_iconoff();
266 $sec_user->set_status_security_action(1);
267 echo $sec_action->get_iconon();
static id()
return the 'gDossier' value after a check
static build($p_serialize)
build a Inplace_Edit object from a serialized string (ajax json parameter = input)
A switch let you switch between 2 values : 0 and 1, it is used to replace the check.
Data & function about connected users.