Project

General

Profile

« Previous | Next » 

Revision 89e3d8f3

Added by Scott Ullrich almost 17 years ago

Remove duplicate function portal_mac_fixed()

View differences:

etc/inc/captiveportal.inc
1100 1100
}
1101 1101

  
1102 1102
function portal_mac_fixed($clientmac) {
1103
	global $g ;
1103
    global $g ;
1104 1104

  
1105
	/* open captive portal mac db */
1106
	if (file_exists("{$g['vardb_path']}/captiveportal_mac.db")) {
1107
		$fd = @fopen("{$g['vardb_path']}/captiveportal_mac.db","r") ;
1108
		if (!$fd) {
1109
			return FALSE;
1110
		}
1111
		while (!feof($fd)) {
1112
			$mac = trim(fgets($fd)) ;
1113
			if(strcasecmp($clientmac, $mac) == 0) {
1114
				fclose($fd) ;
1115
				return TRUE ;
1116
			}
1117
		}
1118
		fclose($fd) ;
1119
	}
1120
	return FALSE ;
1105
    /* open captive portal mac db */
1106
    if (file_exists("{$g['vardb_path']}/captiveportal_mac.db")) {
1107
        $fd = @fopen("{$g['vardb_path']}/captiveportal_mac.db","r") ;
1108
        if (!$fd) {
1109
            return FALSE;
1110
        }
1111
        while (!feof($fd)) {
1112
            $mac = trim(fgets($fd)) ;
1113
            if(strcasecmp($clientmac, $mac) == 0) {
1114
                fclose($fd) ;
1115
                return TRUE ;
1116
            }
1117
        }
1118
        fclose($fd) ;
1119
    }
1120
    return FALSE ;
1121 1121
}
1122 1122

  
1123 1123
?>
usr/local/captiveportal/index.php
200 200
    echo $htmltext;
201 201
}
202 202

  
203
function portal_mac_fixed($clientmac) {
204
    global $g ;
205

  
206
    /* open captive portal mac db */
207
    if (file_exists("{$g['vardb_path']}/captiveportal_mac.db")) {
208
        $fd = @fopen("{$g['vardb_path']}/captiveportal_mac.db","r") ;
209
        if (!$fd) {
210
            return FALSE;
211
        }
212
        while (!feof($fd)) {
213
            $mac = trim(fgets($fd)) ;
214
            if(strcasecmp($clientmac, $mac) == 0) {
215
                fclose($fd) ;
216
                return TRUE ;
217
            }
218
        }
219
        fclose($fd) ;
220
    }
221
    return FALSE ;
222
}
223

  
224 203
function portal_mac_radius($clientmac,$clientip) {
225 204
    global $config ;
226 205

  

Also available in: Unified diff