@@ -137,11 +137,11 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
137
137
} , 500 * ConfigService . timeoutSeconds ) ) , ! 1 ;
138
138
} , authmethod . electionsIds = function ( page ) {
139
139
return page || ( page = 1 ) , $http . get ( backendUrl + "acl/mine/?object_type=AuthEvent&perm=edit&order=-pk&page=" + page ) ;
140
- } , authmethod . sendAuthCodes = function ( eid , election , user_ids , extra ) {
140
+ } , authmethod . sendAuthCodes = function ( eid , election , user_ids , auth_method , extra ) {
141
141
var url = backendUrl + "auth-event/" + eid + "/census/send_auth/" , data = { } ;
142
- return angular . isDefined ( election ) && ( data . msg = election . census . config . msg , "email" === election . census . auth_method && ( data . subject = election . census . config . subject ) ) ,
143
- angular . isDefined ( user_ids ) && ( data [ "user-ids" ] = user_ids ) , extra && ( data . extra = extra ) ,
144
- $http . post ( url , data ) ;
142
+ return angular . isDefined ( election ) && ( data . msg = election . census . config . msg , "email" === authmethod && ( data . subject = election . census . config . subject ) ) ,
143
+ angular . isDefined ( user_ids ) && ( data [ "user-ids" ] = user_ids ) , angular . isDefined ( auth_method ) && ( data [ "auth-method" ] = auth_method ) ,
144
+ extra && ( data . extra = extra ) , $http . post ( url , data ) ;
145
145
} , authmethod . removeUsersIds = function ( eid , election , user_ids ) {
146
146
var url = backendUrl + "auth-event/" + eid + "/census/delete/" , data = {
147
147
"user-ids" : user_ids
@@ -170,11 +170,11 @@ angular.module("avRegistration").factory("Authmethod", [ "$http", "$cookies", "C
170
170
} ] ) , angular . module ( "avRegistration" ) . directive ( "avLogin" , [ "Authmethod" , "StateDataService" , "$parse" , "$state" , "$cookies" , "$i18next" , "$window" , "$timeout" , "ConfigService" , function ( Authmethod , StateDataService , $parse , $state , $cookies , $i18next , $window , $timeout , ConfigService ) {
171
171
function link ( scope , element , attrs ) {
172
172
var adminId = ConfigService . freeAuthId + "" , autheventid = attrs . eventId ;
173
- scope . orgName = ConfigService . organization . orgName , $cookies . authevent && $cookies . authevent === adminId && autheventid === adminId && ( console . log ( "FELIX WINDOW HREF ") ,
174
- $window . location . href = "/admin/elections" ) , scope . sendingData = ! 1 , scope . stateData = StateDataService . getData ( ) ,
175
- scope . code = null , attrs . code && attrs . code . length > 0 && ( scope . code = attrs . code ) ,
176
- scope . email = null , attrs . email && attrs . email . length > 0 && ( scope . email = attrs . email ) ,
177
- scope . isAdmin = ! 1 , autheventid === adminId && ( scope . isAdmin = ! 0 ) , scope . resendAuthCode = function ( field ) {
173
+ scope . orgName = ConfigService . organization . orgName , $cookies . authevent && $cookies . authevent === adminId && autheventid === adminId && ( $window . location . href = "/admin/elections ") ,
174
+ scope . sendingData = ! 1 , scope . stateData = StateDataService . getData ( ) , scope . code = null ,
175
+ attrs . code && attrs . code . length > 0 && ( scope . code = attrs . code ) , scope . email = null ,
176
+ attrs . email && attrs . email . length > 0 && ( scope . email = attrs . email ) , scope . isAdmin = ! 1 ,
177
+ autheventid === adminId && ( scope . isAdmin = ! 0 ) , scope . resendAuthCode = function ( field ) {
178
178
if ( ! scope . sendingData && "sms" === scope . method && scope . telIndex !== - 1 && ! scope . form [ "input" + scope . telIndex ] . $invalid ) {
179
179
field . value = "" ;
180
180
var data = { } ;
0 commit comments