|
@@ 120-128 (lines=9) @@
|
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
switch ($type) { |
| 120 |
|
case 'ip': |
| 121 |
|
$query= sprintf("UPDATE `$table` SET |
| 122 |
|
`active` = '1', |
| 123 |
|
`user` = '%s', |
| 124 |
|
`exp` = TIMESTAMPADD(%s,%d,%s), |
| 125 |
|
`nlist` = %s, |
| 126 |
|
`reason` = '%s' |
| 127 |
|
WHERE `$table`.`$type` = INET_ATON('%s') LIMIT 1" ,$user,$expUnit,$expQ,$exptime,$nlist,$myreason,$value); |
| 128 |
|
break; |
| 129 |
|
case 'network': |
| 130 |
|
list($sub['net'],$sub['mask'])=explode('/',$value); |
| 131 |
|
$query= sprintf("UPDATE `$table` SET |
|
@@ 139-146 (lines=8) @@
|
| 136 |
|
`reason` = '%s' |
| 137 |
|
WHERE (`$table`.`$type` = INET_ATON('%s') AND `$table`.`netmask` = INET_ATON('%s')) LIMIT 1" ,$user,$expUnit,$expQ,$exptime,$nlist,$myreason,$sub['net'],$sub['mask']); |
| 138 |
|
break; |
| 139 |
|
default: |
| 140 |
|
$query= sprintf("UPDATE `$table` SET |
| 141 |
|
`active` = '1', |
| 142 |
|
`user` = '%s', |
| 143 |
|
`exp` = TIMESTAMPADD(%s,%d,%s), |
| 144 |
|
`nlist` = %s, |
| 145 |
|
`reason` = '%s' |
| 146 |
|
WHERE `$table`.`$type` = '%s' LIMIT 1" ,$user,$expUnit,$expQ,$exptime,$nlist,$myreason,$value); |
| 147 |
|
} |
| 148 |
|
|
| 149 |
|
if ($myconn->query($query) === TRUE) { |