mirror of
https://github.com/hohn/codeql-javascript-multiflow.git
synced 2025-12-16 03:53:04 +01:00
31 lines
717 B
JavaScript
31 lines
717 B
JavaScript
var SampleUtility = function(){};
|
|
SampleUtility.prototype = Object.extendsObject(Processor, {
|
|
|
|
setUserStatus: function() {
|
|
var value = this.getParameter('value');
|
|
|
|
var ua = new GR('users');
|
|
ua.query();
|
|
|
|
if(!ua.hasNext()){
|
|
ua.initialize();
|
|
ua.setValue('status',value);
|
|
ua.insert();
|
|
}
|
|
else {
|
|
ua.next();
|
|
ua.setValue('status',value); // unsafe
|
|
ua.update();
|
|
// Nested if() test.
|
|
if (ua.safeToWrite()) {
|
|
ua.setValue('status', value); // safe
|
|
ua.update();
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
|
|
type: 'SampleUtility'
|
|
});
|