diff options
Diffstat (limited to '')
-rw-r--r-- | main/survey/app/Controllers/CheckController.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/main/survey/app/Controllers/CheckController.php b/main/survey/app/Controllers/CheckController.php index d39a6c2..36b11b6 100644 --- a/main/survey/app/Controllers/CheckController.php +++ b/main/survey/app/Controllers/CheckController.php @@ -14,7 +14,7 @@ use enkaParameters; use SurveyInfo;
use SurveyMissingValues;
use Common;
-use Mobile_Detect;
+use AppSettings;
class CheckController extends Controller
@@ -51,6 +51,9 @@ class CheckController extends Controller public function checkGrupa()
{
+ if(get('grupa') == '0' || get('grupa') == '')
+ return false;
+
$sql = sisplet_query("SELECT id FROM srv_spremenljivka WHERE gru_id = '" . get('grupa') . "' ORDER BY vrstni_red");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
while ($row = mysqli_fetch_array($sql)) {
@@ -197,7 +200,7 @@ class CheckController extends Controller if ($row['operator'] == 0 && mysqli_num_rows($sql3) == 0 && mysqli_num_rows($sql3b) == 0)
return false;
- elseif ($row['operator'] == 0 && mysqli_num_rows($sql3b) > 0 && mysqli_num_rows($sql4b) > 0)
+ elseif ($row['operator'] == 0 && mysqli_num_rows($sql3) == 0 && mysqli_num_rows($sql3b) > 0 && mysqli_num_rows($sql4b) > 0)
return false;
elseif ($row['operator'] == 1 && mysqli_num_rows($sql3) > 0)
return false;
@@ -404,7 +407,7 @@ class CheckController extends Controller $browser_detect = get_browser($useragent, true);
- $detect = New Mobile_Detect();
+ $detect = New \Detection\MobileDetect;
$detect->setUserAgent($useragent);
// Detect naprave (pc, mobi, tablet, robot)
@@ -681,8 +684,7 @@ class CheckController extends Controller */
public function check_captcha()
{
- global $secret_captcha;
-
+
// Ce urejamo podatke v admin vmesniku ne preverjamo nicesar
if(isset($_GET['t']) && $_GET['t'] == 'postprocess' || get('grupa') == '0' || get('grupa') == ''){
return;
@@ -696,7 +698,7 @@ class CheckController extends Controller if ($captcha == 1) {
$recaptchaResponse = $_POST['g-recaptcha-response'];
- $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse);
+ $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse);
// zdaj pa zabeleži mail (pred pošiljanjem)
// zdaj pa še v bazi tistih ki so se ročno dodali
@@ -716,10 +718,9 @@ class CheckController extends Controller *
*/
public function check_captcha_intro(){
- global $secret_captcha;
$recaptchaResponse = $_POST['g-recaptcha-response'];
- $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secret_captcha."&response=".$recaptchaResponse);
+ $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".AppSettings::getInstance()->getSetting('google-secret_captcha')."&response=".$recaptchaResponse);
if(strstr($request,"true")){
//
@@ -742,7 +743,7 @@ class CheckController extends Controller $qry = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id='$spremenljivka' AND other IN ('" . implode('\',\'', array_keys($missing_values)) . "')");
$missing_vrednosti = array();
while ($row = mysqli_fetch_assoc($qry)) {
- $missing_vrednosti[] = $row[id];
+ $missing_vrednosti[] = $row['id'];
}
# pogledamo ali imamo kak zapis v srv_data_vrednost. potem je to najbrž missing
|