Code Duplication    Length = 35-36 lines in 3 locations

lib/includes/loader.web.auth.php 3 locations

@@ 96-130 (lines=35) @@
93
		}
94
	}
95
96
	function ldAccessTimeout($path, $message, $args = null, $function = null) {
97
	global $ARCurrent, $store;
98
		/*
99
			since there is no 'peek' function, we need to pop and push
100
			the arCallArgs variable.
101
		*/
102
103
		if( isset( $args ) ) {
104
			$arCallArgs = $args;
105
		} else {
106
			$arCallArgs = @array_pop($ARCurrent->arCallStack);
107
			@array_push($ARCurrent->arCallStack, $arCallArgs);
108
		}
109
110
		$eventData = new baseObject();
111
		$eventData->arCallPath = $path;
112
		$eventData->arCallFunction = ldGetCurrentTemplate( $function );
113
		$eventData->arCallArgs = $arCallArgs;
114
		$eventData->arLoginMessage = $message;
115
		$eventData->arReason = 'access timeout';
116
		$eventData = ar_events::fire( 'onaccessdenied', $eventData );
117
		if ( $eventData ) {
118
119
			$arCallArgs = $eventData->arCallArgs;
120
			$arCallArgs["arLoginMessage"] = $eventData->message;
121
122
			if (!$ARCurrent->arLoginSilent) {
123
				$ARCurrent->arLoginSilent = true;
124
				$store->call("user.session.timeout.html",
125
					$arCallArgs,
126
					$store->get($path) );
127
			}
128
129
		}
130
	}
131
132
	function ldAccessDenied($path, $message, $args = null, $function = null) {
133
	global $ARCurrent, $store;
@@ 132-167 (lines=36) @@
129
		}
130
	}
131
132
	function ldAccessDenied($path, $message, $args = null, $function = null) {
133
	global $ARCurrent, $store;
134
		/*
135
			since there is no 'peek' function, we need to pop and push
136
			the arCallArgs variable.
137
		*/
138
139
		if( isset( $args ) ) {
140
			$arCallArgs = $args;
141
		} else {
142
			$arCallArgs = @array_pop($ARCurrent->arCallStack);
143
			@array_push($ARCurrent->arCallStack, $arCallArgs);
144
		}
145
146
		$eventData = new baseObject();
147
		$eventData->arCallPath = $path;
148
		$eventData->arCallFunction = ldGetCurrentTemplate( $function );
149
		$eventData->arCallArgs = $arCallArgs;
150
		$eventData->arLoginMessage = $message;
151
		$eventData->arReason = 'access denied';
152
153
		$eventData = ar_events::fire( 'onaccessdenied', $eventData );
154
155
		if ( $eventData ) {
156
157
			$arCallArgs = $eventData->arCallArgs;
158
			$arCallArgs["arLoginMessage"] = $eventData->message;
159
160
			if (!$ARCurrent->arLoginSilent) {
161
				$ARCurrent->arLoginSilent = true;
162
				$store->call("user.login.html",
163
					$arCallArgs,
164
					$store->get($path) );
165
			}
166
		}
167
	}
168
169
	function ldAccessPasswordExpired($path, $message, $args=null, $function = null) {
170
	global $ARCurrent, $store;
@@ 169-203 (lines=35) @@
166
		}
167
	}
168
169
	function ldAccessPasswordExpired($path, $message, $args=null, $function = null) {
170
	global $ARCurrent, $store;
171
		/*
172
			since there is no 'peek' function, we need to pop and push
173
			the arCallArgs variable.
174
		*/
175
176
		if( isset( $args ) ) {
177
			$arCallArgs = $args;
178
		} else {
179
			$arCallArgs = @array_pop($ARCurrent->arCallStack);
180
			@array_push($ARCurrent->arCallStack, $arCallArgs);
181
		}
182
183
		$eventData = new baseObject();
184
		$eventData->arCallPath = $path;
185
		$eventData->arCallFunction = ldGetCurrentTemplate( $function );
186
		$eventData->arLoginMessage = $message;
187
		$eventData->arReason = 'password expired';
188
		$eventData->arCallArgs = $arCallArgs;
189
		$eventData = ar_events::fire( 'onaccessdenied', $eventData );
190
		if ( $eventData ) {
191
192
			$arCallArgs = $eventData->arCallArgs;
193
			$arCallArgs["arLoginMessage"] = $eventData->arLoginMessage;
194
195
			if (!$ARCurrent->arLoginSilent) {
196
				$ARCurrent->arLoginSilent = true;
197
				$store->call("user.password.expired.html",
198
					$arCallArgs,
199
					$store->get($path) );
200
			}
201
		}
202
203
	}
204
205
	function ldGenerateSessionKeyCheck() {
206
	global $ARCurrent;