Global.helma.Http.isAuthorized (name, pwd)
static method to check if a request is authorized or not

  • Parameter String:
    username to check req.username against
  • Parameter String:
    password to check req.password against
  • Returns
    Boolean true if request is authorized, false otherwise
Sourcecode in /home/hannes/helma/modules/helma/Http.js:
317:   helma.Http.isAuthorized = function(name, pwd) {
318:       if (!req.username || !req.password || 
319:           req.username != name || req.password != pwd) {
320:           res.reset();
321:           res.status = 401;
322:           res.realm = "Helma Http Authorization";
323:           res.write("Authorization required.");
324:           return false;
325:       } else {
326:          return true;
327:      }
328:  }