Ejemplo n.º 1
0
            $logDebugSQL .= $sql . "\n";
            addGroups($dbSocket, $macaddress, $group_macaddress);
            addUserInfo($dbSocket, $macaddress);
            addUserBillInfo($dbSocket, $username);
            addAttributes($dbSocket, $macaddress);
            $successMsg = "Added to database new mac auth user: <b> {$macaddress} </b>";
            $logAction .= "Successfully added new mac auth user [{$macaddress}] on page: ";
        } elseif ($authType == "pincodeAuth") {
            // insert username/password
            $sql = "INSERT INTO " . $configValues['CONFIG_DB_TBL_RADCHECK'] . " (id,Username,Attribute,op,Value) " . " VALUES (0, '" . $dbSocket->escapeSimple($pincode) . "', 'Auth-Type', ':=', 'Accept')";
            $res = $dbSocket->query($sql);
            $logDebugSQL .= $sql . "\n";
            addGroups($dbSocket, $pincode, $group_pincode);
            addUserInfo($dbSocket, $pincode);
            addUserBillInfo($dbSocket, $username);
            addAttributes($dbSocket, $pincode);
            $successMsg = "Added to database new pincode: <b> {$pincode} </b>";
            $logAction .= "Successfully added new pincode [{$pincode}] on page: ";
        } else {
            echo "unknown authentication method <br/>";
        }
    } else {
        $failureMsg = "user already exist in database: <b> {$username} </b>";
        $logAction .= "Failed adding new user already existing in database [{$username}] on page: ";
    }
    include 'library/closedb.php';
}
include_once 'library/config_read.php';
$log = "visited page: ";
if ($configValues['CONFIG_IFACE_PASSWORD_HIDDEN'] == "yes") {
    $hiddenPassword = "******"password\"";
Ejemplo n.º 2
0
function addSelectListMulti($name, $option_list, $header = NULL, $attr_ar = array(), $OBJ, $vl_selected, $size = 5)
{
    if (is_array($vl_selected)) {
        $vl_selected_arr = $vl_selected;
    } else {
        $vl_selected_arr = explode(",", $vl_selected);
    }
    foreach ($vl_selected_arr as $k => $vl) {
        $sl_arr[$vl] = $vl;
    }
    $str = ${$name} . "<select name=\"{$name}\" id=\"{$name}\" multiple SIZE=\"{$size}\" ";
    if ($attr_ar) {
        $str .= addAttributes($attr_ar);
    }
    $str .= ">\n";
    if (isset($header)) {
        $str .= "  <option value=\"\">{$header}</option>\n";
    }
    foreach ($option_list as $val => $text) {
        $str .= "<option value=\"{$val}\"";
        if (array_key_exists($val, $sl_arr)) {
            $str .= ' selected="selected"';
        }
        // if ( isset($_POST[$name]) && ( trim($_POST[$name]) === trim($val) || trim($_POST[$name]) === trim($text)) || trim($vl_selected)===trim($val) ) {
        // }
        $str .= ">{$text}</option>\n";
    }
    $str .= "</select>";
    $OBJ->assign('_' . $name, $str);
    return $str;
}
Ejemplo n.º 3
0
 function cInput2($type, $name, $value, $attr_ar = array(), $OBJ, $permission)
 {
     global $cla_module;
     if (trim($value) == '') {
         $value = $_POST[$name];
     }
     $str = "<input type=\"{$type}\" name=\"{$name}\" id=\"{$name}\" value=\"{$value}\"";
     if ($attr_ar) {
         $str .= addAttributes($attr_ar);
     }
     $str .= ' />';
     $module = $cla_module;
     if ($_SESSION[_PLATFORM_]["CLA"]["User_Name"] != 'admin' && $this->dont_check_user != true) {
         $p_per = $_SESSION[_PLATFORM_]["CLA"]['RoleData'][$module];
         $tmp = $p_per & $permission;
         if ($tmp == 0) {
             $str = '';
         }
     }
     $OBJ->assign('_' . $name, $str);
     return $str;
 }