hedera-web/package/usr/share/hedera-web/forms/admin/users/users.js

35 lines
681 B
JavaScript
Raw Normal View History

Vn.Users = new Class
({
Extends: Vn.Module
,activate: function ()
{
this.get ('change-user').on ('clicked', this.changeUserClicked.bind (this));
this.get ('access-log').on ('clicked', this.accessLogClicked.bind (this));
}
,changeUserClicked: function (column, value)
{
var batch = new Sql.Batch ();
batch.addValue ('user', value);
var query = 'UPDATE user_session_view SET user_id = #user';
this.conn.execQuery (query, this.userChanged.bind (this), batch);
}
,accessLogClicked: function (column, value)
{
this.hash.set ({
'module': 'access'
,'user': value
});
}
,userChanged: function ()
{
this.hash.set ({'module': 'orders'});
}
});