'use strict';

GLClient.controller('LoginCtrl', ['$scope', '$location', '$routeParams',
  function($scope, $location, $routeParams) {
    var src = $routeParams['src'];

    $scope.loginUsername = "";
    $scope.loginPassword = "";
    $scope.loginRole = "receiver";

    if (src && src.indexOf("/admin") != -1) {
      $scope.loginUsername = "admin";
      $scope.loginRole = "admin";
    };

    $scope.$watch("loginUsername", function(){
      if ($scope.loginUsername == "admin") {
        $scope.loginRole = "admin";
      } else if ($scope.loginUsername == "wb") {
        $scope.loginRole = "wb";
      } else {
        $scope.loginRole = "receiver";
      }
    });

}]);

@@ -80,16 +80,29 @@
 Params',
+ 'Receivers',
 %0A  funct
@@ -136,16 +136,27 @@
 teParams
+, Receivers
 ) %7B%0A    
@@ -245,24 +245,24 @@
 sword = %22%22;%0A
-
     $scope.l
@@ -285,16 +285,104 @@
 iver%22;%0A%0A
+    Receivers.query(function (receivers) %7B%0A      $scope.receivers = receivers;%0A    %7D);%0A%0A
     if (

Fix scope issue for receiver login