public function userSettingSubmit()
 {
     if (!isset($_SESSION['userId'])) {
         $this->error(C('LOGIN_FIRST'));
     }
     $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
     $this->assign('USER_ID', $_SESSION['userId']);
     $this->assign('USER_LEVEL', $_SESSION['userLevel']);
     $this->assign('CURRENT_MENU', 'USER');
     $data['userId'] = $_GET['userid'];
     $exUserPassword = $_POST['exUserPassword'];
     $data['userMail'] = $_POST['userMail'];
     $user = M('user');
     $tempUser = $user->where('userid=' . $_GET['userid'])->limit(1)->select();
     if ($_POST['newUserPassword'] != null) {
         //输入了密码,需要修改密码
         if (strcmp($tempUser[0]['userpassword'], $exUserPassword) == 0) {
             //密码相同,可以修改
             $data['userPassword'] = $_POST['newUserPassword'];
         } else {
             $this->error('输入的旧密码不正确');
             return;
         }
     } else {
         $this->error('输入有误!');
     }
     $result = $user->save($data);
     if ($result !== false) {
         doLog($_SESSION['userId'], 28, 'Edit_User_Setting_Submit');
         $this->success(C('EDIT_SUCCESS'));
     } else {
         $this->error(C('EDIT_FAIL'));
     }
     // $this->show();
 }
 public function logout()
 {
     doLog(0, 10, 'Logout_account_:_' . $_SESSION['userAccount']);
     session('userAccount', null);
     session('userId', null);
     $this->success('退出成功', 'login');
 }
示例#3
0
function mensaje($datos)
{
    $link = Conexion::singleton();
    /*			 $usuario="eureka";
    
                      $clave="eureka";
    
                      $db_host="localhost";
    
                      $bd_nombre="eureka";
    
                      $port = 5432;
    
    
    
                     $link = new PDO('pgsql: host='.$db_host.'; dbname='.$bd_nombre.'; port='.$port, $usuario, $clave);
    
    
    
                    //var_dump($link);
    
    
    
                    */
    $firstname = $datos['contacto']['nombre'];
    $surname = $datos['contacto']['apellido'];
    $tlf = $datos['contacto']['tlf'];
    $emailaddress = $datos['contacto']['correo'];
    $mensaje = $datos['contacto']['mensaje'];
    $query = "INSERT INTO mensajes(nombre, apellido, telefono, correo, mensaje) VALUES('" . $firstname . "', '" . $surname . "', '" . $tlf . "', '" . $emailaddress . "', '" . $mensaje . "')";
    $result = $link->prepare($query);
    $result = $result->execute();
    if (!$result) {
        $errormessage = $link->errorInfo();
        echo json_encode(['code' => 0, 'mensaje' => 'Hubo un error procesando tu mensaje, por favor intentalo de nuevo.']);
        return "Error with query: " . $errormessage;
    }
    /*		@mail("*****@*****.**",
    
                        "Mensaje de: ".$firstname." ".$surname,
    
                        "Datos de contacto: ".$tlf."<br><br>".$mensaje,
    
                        "From: ". $emailaddress . "\r\n" . "Content-Type: text/html; charset=utf-8"/*,
    
                        "*****@*****.**");*/
    // Guardar en archivo.txt
    doLog("Datos de la persona: " . $firstname . " " . $surname . " Teléfono: " . $tlf . " Correo: " . $emailaddress . " Mensaje: " . $mensaje . "", "logs/mensajes.txt");
    // Guardar en archivo CSV
    doLog("" . $firstname . ";" . $surname . ";" . $tlf . ";" . $emailaddress . ";" . $mensaje . "", "logs/mensajes.csv");
    echo json_encode(["code" => 1, "mensaje" => "Listo, tu mensaje ya fue recibido, te contactaremos."]);
    //return  "Listo, tu mensaje ya fue recibido, te contactaremos.";
}
示例#4
0
 function parseRequest()
 {
     global $_SITE_CONFIG;
     $request = $_GET ? $_GET : $_POST;
     $module = $request['module'];
     $method = $request['method'];
     $log = $request;
     $log['paramsArray'] = $this->myAddslashes(unserialize($request['params']));
     doLog($log, empty($_POST) ? '$_GET: ' : '$_POST: ');
     $errCode = 0;
     $errMessage = '';
     if ($_SITE_CONFIG['site_close']) {
         $errCode = 2;
         $errMessage = 'Site Closed';
     } elseif (!$_SITE_CONFIG['my_status']) {
         $errCode = 2;
         $errMessage = 'Manyou Service Disabled';
     } elseif (!$_SITE_CONFIG['site_key']) {
         $errCode = 11;
         $errMessage = 'Client SiteKey NOT Exists';
     } elseif (!$_SITE_CONFIG['my_site_key']) {
         $errCode = 12;
         $errMessage = 'My SiteKey NOT Exists';
     } elseif (empty($module) || empty($method)) {
         $errCode = '3';
         $errMessage = 'Invalid Method: ' . $moudle . '.' . $method;
     }
     if (get_magic_quotes_gpc()) {
         $request['params'] = sstripslashes($request['params']);
     }
     $mySign = $module . '|' . $method . '|' . $request['params'] . '|' . $_SITE_CONFIG['my_site_key'];
     $mySign = md5($mySign);
     if ($mySign != $request['sign']) {
         $errCode = '10';
         $errMessage = 'Error Sign';
     }
     if ($errCode) {
         return new APIErrorResponse($errCode, $errMessage);
     }
     $params = unserialize($request['params']);
     $params = $this->myAddslashes($params);
     if ($module == 'Batch' && $method == 'run') {
         $response = array();
         foreach ($params as $param) {
             $response[] = $this->callback($param['module'], $param['method'], $param['params']);
         }
         return new APIResponse($response, 'Batch');
     }
     return $this->callback($module, $method, $params);
 }
 public function allSignUp()
 {
     if (!isset($_SESSION['userId'])) {
         $this->error(C('LOGIN_FIRST'));
     }
     doLog($_SESSION['userId'], 33, 'View_allBranchApperance');
     $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
     $this->assign('USER_ID', $_SESSION['userId']);
     $this->assign('CURRENT_MENU', 'SIGNUP');
     $signUp = M('signup');
     try {
         if (isset($_GET['delete'])) {
             // 传入删除参数
             $signUp->where('signupid=' . $_GET['delete'])->delete();
         }
         if (isset($_GET['deleteMulti'])) {
             // 传入删除多项的参数
             $multi = explode(',', $_GET['deleteMulti']);
             for ($index = 1; $index < count($multi); $index++) {
                 // 从第二个开始删除,第一个的产生是由于U方法生成参数的时候无法不输入一个参数
                 if ($multi[$index] != null) {
                     $signUp->where('signupid=' . $multi[$index])->delete();
                 }
             }
         }
     } catch (Exception $e) {
         // 删除错误
         $this->error(C('DELETE_FAIL') . $e->__toString());
         return;
     }
     // 查询当前所有的工作状态并且分页
     $count = $signUp->count();
     $page = new \Think\Page($count, C('PAGE_COUNT'), 'p1');
     $page->setP('p1');
     $orderby['signupid'] = 'desc';
     $list = $signUp->order($orderby)->limit($page->firstRow . ',' . $page->listRows)->select();
     // dump($list);
     // return;
     $this->assign('list', $list);
     // 赋值数据集
     $this->assign('page', $page->show());
     // 赋值分页输出
     $this->display();
 }
示例#6
0
 function publishTemplatizedAction($uId, $appId, $titleTemplate, $titleData, $bodyTemplate, $bodyData, $bodyGeneral = '', $image1 = '', $image1Link = '', $image2 = '', $image2Link = '', $image3 = '', $image3Link = '', $image4 = '', $image4Link = '', $targetIds = '', $privacy = '', $hashTemplate = '', $hashData = '', $specialAppid = 0)
 {
     global $_SITE_CONFIG;
     $db_prefix = getDbPrefix();
     $site_userapp_url = SITE_URL . '/apps/myop/userapp.php';
     $site_cp_url = SITE_URL . '/apps/myop/cp.php';
     if (strpos($titleTemplate, MYOP_URL) === false) {
         $titleTemplate = str_replace('userapp.php', $site_userapp_url, $titleTemplate);
         $titleTemplate = str_replace('cp.php', $site_cp_url, $titleTemplate);
     }
     foreach ($titleData as $k => $v) {
         if (strpos($titleTemplate, MYOP_URL) === false) {
             $v = str_replace('userapp.php', $site_userapp_url, $v);
             $v = str_replace('cp.php', $site_cp_url, $v);
         }
         $titleTemplate = str_replace('{' . $k . '}', $v, $titleTemplate);
     }
     if (strpos($bodyTemplate, MYOP_URL) === false) {
         $bodyTemplate = str_replace('userapp.php', $site_userapp_url, $bodyTemplate);
         $bodyTemplate = str_replace('cp.php', $site_cp_url, $bodyTemplate);
     }
     foreach ($bodyData as $k => $v) {
         if (strpos($bodyTemplate, MYOP_URL) === false) {
             $v = str_replace('userapp.php', $site_userapp_url, $v);
             $v = str_replace('cp.php', $site_cp_url, $v);
         }
         $bodyTemplate = str_replace('{' . $k . '}', $v, $bodyTemplate);
     }
     $titleTemplate = str_replace('{actor}', '', $titleTemplate);
     $bodyTemplate = str_replace('{actor}', '<a href="' . U('home/Space/index', array('uid' => $uId)) . '">' . getUserName($uId) . '</a>', $bodyTemplate);
     $content = array('title' => stripslashes($titleTemplate), 'content' => stripslashes($bodyTemplate), 'image1' => $image1, 'image1Link' => $image1Link, 'image2' => $image2, 'image2Link' => $image2Link, 'image3' => $image3, 'image3Link' => $image3Link, 'image4' => $image4, 'image4Link' => $image4Link);
     doLog($content, 'ContetArray');
     $content = serialize($content);
     $ctime = time();
     $sql = "INSERT INTO {$db_prefix}feed (`uid`,`data`,`type`,`ctime`) VALUES \r\n\t\t\t\t\t   ({$_SITE_CONFIG['uid']}, '{$content}', 'myop_feed','{$ctime}')";
     $result = doQuery($sql);
     return new APIResponse($result);
 }
示例#7
0
 public function logTest()
 {
     doLog(1, 2, '中文测试');
 }
                $response->records = $count;
                $i = 0;
                while ($row = pg_fetch_assoc($result)) {
                    //doLog(print_r($row,true));
                    $vip = $row[$hfield_guests . '_vip'] === 'f' ? 0 : 1;
                    $response->d[$i] = array("id" => $row[$hfield_guests . '_id'], "group" => $row[$hfield_groups . '_name'], "seat" => $row[$hfield_seatings . '_id'], "title" => $row[$hfield_titles . '_name'], "VIP" => $vip, "lastname" => $row[$hfield_guests . '_lastname'], "firstname" => $row[$hfield_guests . '_firstname'], "display" => $row[$hfield_guests . '_display'], "gender" => $row[$hfield_genders . '_name'], "age" => $row[$hfield_ages . '_name'], "meal" => $row[$hfield_meals . '_name'], "request" => $row[$hfield_requests . '_name'], "RSVP" => $row[$hfield_rsvps . '_name']);
                    //doLog("data:".join($row,","));
                    $i++;
                }
                $response->status = 0;
                $response->responseText = "Successful.";
            } else {
                $response->status = 1;
                $response->responseText = "Cannot execute query: {$query}, Error" . pg_last_error($connection);
            }
        } else {
            $response->status = 1;
            $response->responseText = "Cannot execute query: {$query}, Error" . pg_last_error($connection);
        }
}
doLog("Preparing the reponse");
if ($custom_status !== 200) {
    header("Content-type: application/json;charset=utf-8");
    header('X-Error-Message: ' . $custom_error, true, $custom_status);
    die;
} else {
    header("Content-type: application/json;charset=utf-8");
    header("HTTP/1.0 200 OK");
    //doLog(json_encode($response));
    echo json_encode($response);
}
    public function editUserSubmit()
    {
        if (!isset($_SESSION['userId'])) {
            $this->error(C('LOGIN_FIRST'));
        }
        $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
        $this->assign('USER_ID', $_SESSION['userId']);
        $this->assign('USER_LEVEL', $_SESSION['userLevel']);
        $this->assign('CURRENT_MENU', 'SYSTEMSETTING');
        $user = M('user');
        $data['userId'] = $_GET['userid'];
        $data['userNickname'] = $_POST['usernickname'];
        $data['userPassword'] = $_POST['userpassword'];
        $data['userAddress'] = $_POST['useraddress'];
        $data['userTelnumber'] = $_POST['usertelnumber'];
        $data['userDescription'] = $_POST['userdescription'];
        $data['userAcademy'] = $_POST['useracademy'];
        $data['userMail'] = $_POST['usermail'];
        $data['userAcademy'] = $_POST['useracademy'];
        $data['userBranch'] = $_POST['userbranch'];
        // dump($data);
        // return;
        $result = $user->save($data);
        if ($result !== false) {
            // echo U('WorkTendency/allPage');
            doLog($_SESSION['userId'], 26, 'Edit_User_Submit_id_:_' . $_GET['userid']);
            echo '
					<head>
						<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
					</head>
					<h1 style="line-height:400px;text-align:center">成功,1秒后自动关闭</h1>
					<script language="javascript">
						function closeWindow(){
							window.opener=null;
							window.open("","_self")
							window.close();
						}
						setTimeout("closeWindow()",1000);
	
					</script>';
            // $this->success ( C ( 'EDIT_SUCCESS' ), '/WorkTendency/allPage' );
        } else {
            $this->error(C('EDIT_FAIL'));
        }
    }
示例#10
0
                    printf("# EDIT %s <fail> <%s> (%d): <%s> (<%s>)\n", $typeMap[$pages[$pageId]['bad']], $query['title'], $pageId, $data2['error']['info'], $data2['error']['code']);
                    $log .= sprintf("# EDIT (Fehlgeschlagen [%s]) %s [{{fullurl:%s|curid=%d&oldid=%d}} %s]\n", htmlentities($data2['error']['info'], ENT_QUOTES, 'UTF-8'), $typeMap[$pages[$pageId]['bad']], $query['title'], $pageId, $query['lastrevid'], $query['title']);
                    unset($stockIds[$pageId]);
                } else {
                    fail('Edit fehlgeschlagen', $result);
                }
            } else {
                printf("# EDIT %s <%s> <%s> (%d) (old %d) (new %d)  Sleeping ", $typeMap[$pages[$pageId]['bad']], $data2['edit']['result'], $data2['edit']['title'], $data2['edit']['pageid'], $data2['edit']['oldrevid'], $data2['edit']['newrevid']);
                //    var_dump($data2);
                //    var_dump($pages[$pageId]);
                $log .= sprintf("# EDIT (%s) %s [{{fullurl:%s|curid=%d&diff=%d&oldid=%d}} %s] by [[{{subst:FULLPAGENAME:User:%s}}|]]\n", $data2['edit']['result'], $typeMap[$pages[$pageId]['bad']], $data2['edit']['title'], $pageId, $data2['edit']['newrevid'], $data2['edit']['oldrevid'], $data2['edit']['title'], $pages[$pageId]['rev_user_text'], $pages[$pageId]['rev_user_text']);
                for ($i = 19; $i > 0; --$i) {
                    print $i . ' ';
                    usleep(900000);
                }
                print "0\n";
            }
        }
    } while (false);
}
if ($stockIds) {
    mysql_query('
	DELETE FROM
	  `u_revolus`.`bestandscheck`
	WHERE
	  `page_id` IN (' . implode(', ', $stockIds) . ')
	', $link) or fail(mysql_error());
}
doLog();
curl_close($curl);
mysql_close($link);
                if ($start < 0) {
                    $start = 0;
                }
                $query = "select * from " . DB_SCHEMA . ".{$table} where deleted = 0 order by {$sidx} {$sord}  LIMIT {$limit} OFFSET {$start}";
                doLog($query);
                $result = pg_query($connection, $query) or die("Cannot execute query: {$query}\n");
                $response->page = $page;
                $response->total = $total_pages;
                $response->records = $count;
                $i = 0;
                while ($row = pg_fetch_assoc($result)) {
                    $response->d[$i] = array("id" => $row[$hfield . '_id'], "name" => $row[$hfield . '_name'], "note" => $row[$hfield . '_note']);
                    doLog("id=>" . $row[$hfield . '_id'] . " name=>" . $row[$hfield . '_name'] . " note=>" . $row[$hfield . '_note']);
                    $i++;
                }
                $response->status = 0;
                $response->responseText = "Successful.";
            } else {
                $response->status = 1;
                $response->responseText = "Cannot execute query: {$query}";
            }
    }
} else {
    $response->page = 1;
    $response->total = 1;
    $response->records = 0;
}
doLog("Preparing the reponse");
header("Content-type: application/json;charset=utf-8");
doLog(json_encode($response));
echo json_encode($response);
    public function editBranchApperanceSubmit()
    {
        if (!isset($_SESSION['userId'])) {
            $this->error(C('LOGIN_FIRST'));
        }
        $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
        $this->assign('USER_ID', $_SESSION['userId']);
        $this->assign('USER_LEVEL', $_SESSION['userLevel']);
        $this->assign('CURRENT_MENU', 'BRANCHAPPERANCE');
        $branchapperance = M('branchapperance');
        $data['branchApperanceId'] = $_GET['branchapperanceid'];
        $data['branchApperanceTitle'] = $_POST['branchapperanceTitle'];
        $data['branchApperanceReleaseId'] = $_POST['branchapperancereleaseid'];
        $data['branchApperanceAcademy'] = $_POST['branchapperanceacademy'];
        $data['branchApperanceBranch'] = $_POST['branchapperancebranch'];
        // 		dump ( $_POST ['branchapperancebranch']);
        // 		return;
        // $workTendency-> where('worktendencyid=' . $_GET['worktendencyid'])->setField('worktendencytitle',$_POST['workTendencyTitle']);
        // $workTendency-> where('worktendencyid=' . $_GET['worktendencyid'])->setField('worktendencyreleaseid',$_POST['workTendencyReleaseId']);
        // $workTendency-> where('worktendencyid=' . $_GET['worktendencyid'])->setField('worktendencyreleasedate',date ( 'Y-m-d H:i:s', time () ));
        // 创建内容的html文件
        $myFilePath = C('APPLICATION_CONTENTHTML_PATH') . '/' . time() . rand() . '.html';
        $myFile = fopen($myFilePath, "w") or die("Unable to open file!");
        fwrite($myFile, $_POST['editor']);
        fclose($myFile);
        $data['branchApperanceContentURL'] = $myFilePath;
        // $workTendency-> where('workTendencyId=' . $_GET['worktendencyid'])->setField('worktendencycontenturl',$myFilePath);
        $result = $branchapperance->save($data);
        doLog($_SESSION['userId'], 36, 'Edit_BranchApperance_submit_Id_:_' . $_GET['branchapperanceid']);
        if ($result !== false) {
            // echo U('WorkTendency/allPage');
            echo '
					<head>
						<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
					</head>
					<h1 style="line-height:400px;text-align:center">成功,1秒后自动关闭</h1>
					<script language="javascript">
						function closeWindow(){
							window.opener=null;
							window.open("","_self")
							window.close();
						}
						setTimeout("closeWindow()",1000);
						
					</script>';
            // $this->success ( C ( 'EDIT_SUCCESS' ), '/WorkTendency/allPage' );
        } else {
            $this->error(C('EDIT_FAIL'));
        }
    }
示例#13
0
        mkdir(LOG);
    }
    $file = LOG . '/report.log';
    // Write the contents back to the file
    //echo "do loging to $file";
    file_put_contents($file, "{$log}\n", FILE_APPEND | LOCK_EX);
}
$l = $_POST['l'];
// get the requested page
$e = $_POST['e'];
// get the requested page
$v = $_POST['v'];
// get the requested page
doLog("Parameters received : \n" . "\te = " . $e . "\n" . "\tv = " . $v . "\n" . "\tl = " . $l . "\n" . "\tHost = " . DB_HOST . "\n" . "\tPort = " . DB_PORT . "\n" . "\tDBName = " . DB_NAME . "\n" . "\tUser = "******"\n" . "\tPwd = " . DB_PASSWORD);
// connect to pgsql
$connection = pg_Connect(DSN) or die("Could not connect to server\n");
pg_query($connection, "set names 'utf8'");
$query = "select t.title_name, g.guest_firstname, g.guest_lastname, g.guest_display, s.seating_id, cast(substr(s.seating_id,5) as integer)\nfrom " . DB_SCHEMA . ".seatings s,  " . DB_SCHEMA . ".guests g, " . DB_SCHEMA . ".titles t\nwhere s.guest_id = g.guest_id\nand g.title_id = t.title_id\nand s.event_id = " . $e . "\nand s.layout_id = (select layout_id from " . DB_SCHEMA . ".layouts where layout_name='" . $l . "' and venue_id=" . $v . ") order by 6 asc";
doLog($query);
$result = pg_query($connection, $query);
if ($result) {
    while ($row = pg_fetch_array($result)) {
        $response[] = $row;
    }
    header("Content-type: application/json;charset=utf-8");
    doLog(json_encode($response));
    echo json_encode($response);
} else {
    doLog("Failed to execute the query : " . pg_last_error($connection));
    die("Cannot execute query: {$query}\n");
}
    public function editDownloadSubmit()
    {
        if (!isset($_SESSION['userId'])) {
            $this->error(C('LOGIN_FIRST'));
        }
        $this->assign('APPLICATION_NAME', C('APPLICATION_NAME'));
        $this->assign('USER_ID', $_SESSION['userId']);
        $this->assign('USER_LEVEL', $_SESSION['userLevel']);
        $this->assign('CURRENT_MENU', 'WORKTENDENCY');
        $download = M('download');
        $data['downloadId'] = $_GET['downloadid'];
        $data['downloadTitle'] = $_POST['downloadTitle'];
        // 		dump($data);
        // 		return;
        // 文件上传
        $upload = new \Think\Upload();
        // 实例化上传类
        $upload->maxSize = 3145728;
        // 设置附件上传大小
        $upload->exts = array('jpg', 'gif', 'png', 'jpeg', 'doc', 'docx', 'apk', 'xls', 'ppt', 'pptx', 'rar', 'zip', 'pdf');
        // 设置附件上传类型
        $upload->rootPath = C('APPLICATION_DOWNLOAD_PATH');
        // 设置附件上传根目录
        // $upload->savePath = 'Download'; // 设置附件上传(子)目录
        // 上传文件
        $info = $upload->upload();
        doLog($_SESSION['userId'], 8, 'edit_Download_Submit_Id_:_' . $_GET['downloadid']);
        if (!$info) {
            // 上传错误提示错误信息
            echo '
					<head>
						<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
					</head>
					<h1 style="line-height:400px;text-align:center">上传错误:' . $upload->getError() . ',1秒后自动关闭</h1>
					<script language="javascript">
						function closeWindow(){
							window.opener=null;
							window.open("","_self")
							window.close();
						}
						setTimeout("closeWindow()",1000);
						
					</script>';
            return;
        } else {
            // 上传成功 获取上传文件信息
            foreach ($info as $file) {
                // echo $file['savepath'].$file['savename'].'<br />';
                // echo $file['name'];
                $data['fileName'] = $file['name'];
                $data['downloadURL'] = $file['savename'];
            }
        }
        // $workTendency-> where('workTendencyId=' . $_GET['worktendencyid'])->setField('worktendencycontenturl',$myFilePath);
        $result = $download->save($data);
        if ($result !== false) {
            // echo U('WorkTendency/allPage');
            echo '
					<head>
						<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
					</head>
					<h1 style="line-height:400px;text-align:center">成功,1秒后自动关闭</h1>
					<script language="javascript">
						function closeWindow(){
							window.opener=null;
							window.open("","_self")
							window.close();
						}
						setTimeout("closeWindow()",1000);
						
					</script>';
            // $this->success ( C ( 'EDIT_SUCCESS' ), '/WorkTendency/allPage' );
        } else {
            $this->error(C('EDIT_FAIL'));
        }
    }
示例#15
0
     $response["Mesaj"] = "Giriş Yapılmadı";
     echoRespnse(200, $response);
     return;
 }
 $SoruID = $app->request->post("SoruID");
 $ResimNo = $app->request->post("ResimNo");
 doLog($ResimNo);
 $Oy = false;
 if ($ResimNo == 0) {
     $Oy = false;
 } else {
     if ($ResimNo == 1) {
         $Oy = true;
     }
 }
 doLog($Oy);
 if (isset($SoruID) && isset($UyeID) && isset($ResimNo)) {
     if ($db->OyladiMi($UyeID, $SoruID) == false) {
         if ($db->Oyla($UyeID, $SoruID, $Oy) == false) {
             $response["Sonuc"] = false;
             $response["Mesaj"] = "Oy Eklenemedi";
         } else {
             $response["Sonuc"] = true;
             $response["Mesaj"] = "Oy Eklendi";
         }
     } else {
         if ($db->OyGuncelle($UyeID, $SoruID, $Oy) == false) {
             $response["Sonuc"] = false;
             $response["Mesaj"] = "Oy Güncellenemedi";
         } else {
             $response["Sonuc"] = true;
                    } else {
                        $json_array['success'] = false;
                        $json_array['message'][] = "Please specify API endpoint";
                    }
                } else {
                    if ($api_user == "guest") {
                        checkIfCookieExists($json_array, true);
                        $json_array['success'] = false;
                        $json_array['message'][] = "Reset API key";
                    } else {
                        $json_array['success'] = false;
                        $json_array['message'][] = "Supplied API key has been disabled";
                    }
                }
            } else {
                $json_array['success'] = false;
                $json_array['message'][] = "API Key not found";
            }
            mysqli_close($GLOBALS['conn']);
            $GLOBALS['conn'] = null;
        } else {
            $json_array['success'] = false;
            $json_array['message'][] = "API Key was provided in the incorrect format";
        }
    }
} else {
    $json_array['success'] = false;
    $json_array['message'][] = "No API key supplied";
}
doLog($json_array);
print json_encode($json_array);
示例#17
0
<?php

include "../database/database.php";
$deviceId = $_GET["deviceId"];
$module = $_GET["module"];
$os_version = $_GET["os_version"];
$mail = $_GET["mail"];
$build_desc = $_GET["build_desc"];
$action = $_GET["action"];
$result = doLog($deviceId, $module, $os_version, $mail, $build_desc, $action);
echo $result;
function doLog($d, $m, $o, $mail, $b, $action)
{
    $nid = generateId("root_tools_log", "id");
    date_default_timezone_set("Asia/Hong_Kong");
    $sql = "insert into root_tools_log values ('" . $nid . "', '" . $d . "', '" . $m . "', '" . $o . "', '" . $mail . "', '" . $b . "', '" . $action . "', '" . date("Y-m-d h:i a") . "')";
    $db = openConnection();
    $str = query($db, $sql);
    closeConnection($db);
    $str = "{\"result\":\"" . $str . "\"}";
    return $str;
}
示例#18
0
    $res_event = "";
    $res_width = 0;
    $res_height = 0;
    $i = 0;
    while ($row = pg_fetch_array($result)) {
        $res_id = $row[0];
        $res_venue_id = $row[2];
        $res_event_id = $row[3];
        $res_layout = $row[4];
        $res_venue = $row[5];
        $res_event = $row[6] === null ? "NA" : $row[6];
        $res_width = $row[7];
        $res_height = $row[8];
        $i++;
    }
    doLog("Layout is {$res_id}");
    if ($res_id != "") {
        $pagecontents = str_replace("<!--phpcode-->", '
		
		<script>$( document ).ready(function() {

		
		svgEditor.addExtension("server_ems_dbopen", function (){
		
			var curConfig = {
			initFill: {
				//\'FFFFFF\',
				color: svgEditor.curConfig[\'initFill\'].color,  
				//1
				opacity: svgEditor.curConfig[\'initFill\'].opacity 
			},
示例#19
0
<?php

include "../database/database.php";
$deviceId = $_GET["deviceId"];
$module = $_GET["module"];
$os_version = $_GET["os_version"];
$mail = $_GET["mail"];
$build_desc = $_GET["build_desc"];
$comment = $_GET["comment"];
$app_version = $_GET["app_version"];
if (empty($deviceId) || empty($comment)) {
    echo "{\"result\":\"0\"}";
    return;
}
if (empty($app_version) || $app_version == null) {
    $app_version = "low";
}
$result = doLog($deviceId, $module, $os_version, $mail, $build_desc, $comment, $app_version);
echo $result;
function doLog($d, $m, $o, $mail, $b, $comment, $app)
{
    $nid = generateId("root_tools_feedback", "id");
    date_default_timezone_set("Asia/Hong_Kong");
    $sql = "insert into root_tools_feedback(id,deviceId,module,os_version,mail,build_desc,comment,comment_time,app_version) values ('" . $nid . "', '" . $d . "', '" . $m . "', '" . $o . "', '" . $mail . "', '" . $b . "', '" . $comment . "', '" . date("Y-m-d h:i a") . "', '{$app}')";
    $db = openConnection();
    $str = query($db, $sql);
    closeConnection($db);
    $str = "{\"result\":\"" . $str . "\"}";
    return $str;
}
    if ($auth->auth['uname'] == 'admin') {
        $query = sprintf("UPDATE meanings\n\t\t\tSET subject_id = %s,\n\t\t\t\tmorphologic_id = %s,\n\t\t\t\t%s\n\t\t\t\thidden = %s\n\t\t\tWHERE\n\t\t\t\tid = %d", $new_id, $morphologic_sql, $distinction_sql, myaddslashes($new_hidden), myaddslashes(uservar('mid')));
    } else {
        $query = sprintf("UPDATE meanings\n\t\t\tSET subject_id = %s\n\t\t\t\tmorphologic_id = %s\n\t\t\tWHERE\n\t\t\t\tid = %d", $new_id, $morphologic_sql, myaddslashes(uservar('mid')));
    }
    $db->query($query);
    $query = sprintf("SELECT subject FROM subjects WHERE id = %d", $new_id);
    $db->query($query);
    $db->next_record();
    $new_subject = $db->f('subject');
    doLog(getSynsetString(uservar('mid'), 3), uservar('mid'), CHANGE_SUBJECT, uservar('oldsubject') . "->" . $new_subject);
    $query = sprintf("SELECT morphologic FROM morphologics WHERE id = %d", $morphologic_sql);
    $db->query($query);
    $db->next_record();
    $new_morphologic = $db->f('morphologic');
    doLog(getSynsetString(uservar('mid'), 3), uservar('mid'), CHANGE_SUBJECT, uservar('oldmorphologic') . "->" . $new_morphologic);
    $changed = 1;
}
$query = sprintf("SELECT id, subject_id, morphologic_id, distinction, hidden\n\tFROM meanings\n\tWHERE id = %d", myaddslashes(uservar('mid')));
$db->query($query);
if ($db->nf() == 0) {
    print "ID not found";
    return;
}
$db->next_record();
$subject_id = $db->f('subject_id');
$morphologic_id = $db->f('morphologic_id');
$title = sprintf(T_("Details for synset '%s'"), getSynsetString(uservar('mid'), 3));
function popdownlist()
{
    global $db, $subject_id;
    if ($found && $val == 'delete') {
        $id = intval($matches[1]);
        array_push($del_list, $id);
    }
}
if (sizeof($del_list) >= sizeof(getSynset(uservar('meaning_id')))) {
    print T_("You cannot remove all synonyms of a synset. Use the checkbox to delete the synset instead.");
    page_close();
    return;
}
foreach ($del_list as $id) {
    # delete from synset
    $query = sprintf("SELECT word FROM words WHERE id = %d", $id);
    $db->query($query);
    $db->next_record();
    doLog(unescape($db->f('word')), uservar('meaning_id'), REMOVE_SYNONYM);
    $query = sprintf("DELETE FROM word_meanings\n\t\tWHERE\n\t\t\tword_id = %d AND\n\t\t\tmeaning_id = %d", $id, uservar('meaning_id'));
    $db->query($query);
}
if (uservar('do_remove') == 1) {
    $title = T_("Synset removed");
    include "include/top.php";
    ?>
	<p><?php 
    print sprintf(T_("The synset <span class='inp'>%s</span> has been deleted."), join(', ', getSynset(uservar('meaning_id'))));
    ?>
</p>

	<p><a href="./"><?php 
    print T_("Return to homepage");
    ?>
// Take off the 3 turns for attacking
$player->take_turns(3);
$player->update();
// fire shots
if (DEBUG) {
    print "Pre Shots<br>";
}
portFires($fleet, $port, $players);
fleetFires($fleet, $port, $players, $weapons);
//get results in a way we want them
$results = processResults($players, $port, $fleet, $weapons);
//post on alliances MB or send to player
portDowngrade($results, $port);
sendReport($results, $port);
//log player
doLog($results);
//insert into combat logs
$finalResults = $results[0] . '<br /><img src="images/portAttack.jpg" width="480px" height="330px" alt="Port Attack" title="Port Attack"><br />' . $results[1];
$db->query('INSERT INTO combat_logs VALUES("",' . SmrSession::$game_id . ',"PORT",' . $player->sector_id . ',' . time() . ',' . SmrSession::$old_account_id . ',' . $player->alliance_id . ',0,0,"' . mysql_real_escape_string(gzcompress($finalResults)) . '", "FALSE")');
if (DEBUG) {
    print "Pre Forward/Display<br>";
}
$container = array();
$container["url"] = "skeleton.php";
$container["body"] = "port_attack_new.php";
$container["results"] = $results;
if ($players[$player->account_id][KILLER]) {
    $container['override_death'] = TRUE;
}
$container["continue"] = checkContinue($players, $port);
forward($container);
        $new_hidden = 0;
    } else {
        $new_hidden = 1;
    }
    $query = "";
    if ($auth->auth['uname'] == 'admin') {
        $query = sprintf("UPDATE meanings\n\t\t\tSET subject_id = %s,\n\t\t\t\t%s\n\t\t\t\thidden = %s\n\t\t\tWHERE\n\t\t\t\tid = %d", $new_id, $distinction_sql, myaddslashes($new_hidden), myaddslashes(uservar('mid')));
    } else {
        $query = sprintf("UPDATE meanings\n\t\t\tSET subject_id = %s\n\t\t\tWHERE\n\t\t\t\tid = %d", $new_id, myaddslashes(uservar('mid')));
    }
    $db->query($query);
    $query = sprintf("SELECT subject FROM subjects WHERE id = %d", $new_id);
    $db->query($query);
    $db->next_record();
    $new_subject = $db->f('subject');
    doLog(getSynsetString(uservar('mid'), 3), uservar('mid'), CHANGE_SUBJECT, uservar('oldsubject') . "->" . $new_subject);
    $changed = 1;
}
$query = sprintf("SELECT id, subject_id, distinction, hidden\n\tFROM meanings\n\tWHERE id = %d", myaddslashes(uservar('mid')));
$db->query($query);
if ($db->nf() == 0) {
    print "ID not found";
    return;
}
$db->next_record();
$subject_id = $db->f('subject_id');
$title = sprintf(_("Details for synset '%s'"), getSynsetString(uservar('mid'), 3));
function popdownlist()
{
    global $db, $subject_id;
    $query = "SELECT id, subject FROM subjects ORDER By subject";
function setNewAntonym($thisWMID, $newWMID)
{
    global $db;
    $this_id = myaddslashes($thisWMID);
    $new_antonym_id = myaddslashes($newWMID);
    $query = sprintf("SELECT id FROM antonyms\n\t\tWHERE word_meaning_id1 = %d OR word_meaning_id2 = %d", $this_id, $this_id);
    #print $query."<p>";
    $db->query($query);
    if ($db->nf() == 0) {
        $next_id = $db->nextid("antonyms");
        # The INSERT statement can lead to an duplicate key error if the new antonym
        # is already connected to a different word as its antonym, so check before:
        $query = sprintf("SELECT * FROM antonyms WHERE word_meaning_id1 = %d OR word_meaning_id2 = %d", myaddslashes($newWMID), myaddslashes($newWMID));
        $db->query($query);
        if ($db->nf() > 0) {
            print T_("Error: the antonym you selected is already connected to a different word.");
            exit;
        }
        $query = sprintf("INSERT INTO antonyms (id, word_meaning_id1, word_meaning_id2)\n\t\t\tVALUES (%d, %d, %d)", $next_id, myaddslashes($newWMID), myaddslashes($thisWMID));
        #print $query;
        $db->query($query);
        // Logging:
        // FIXME: should be moved before the INSERT query is executed, but the
        // INSERT can lead to an error and we don't want to log the action in that case:
        list($word1, $mid) = getAntonymWord($this_id, $db);
        list($word2, $mid) = getAntonymWord($newWMID, $db);
        doLog(join(', ', getSynset($this_id, 3)), $mid, ADD_ANTONYM, $word1 . "<->" . $word2);
    } else {
        if ($db->nf() == 1) {
            // Logging:
            list($word1, $mid) = getAntonymWord($this_id, $db);
            list($word2, $mid) = getAntonymWord($newWMID, $db);
            doLog(join(', ', getSynset($this_id, 3)), $mid, CHANGE_ANTONYM, $word1 . "<->" . $word2);
            # one of the next two UPDATE statements will succeed:
            $query = sprintf("UPDATE antonyms\n\t\t\tSET word_meaning_id2 = %d\n\t\t\tWHERE word_meaning_id1 = %d", $newWMID, $this_id);
            #print $query."<p>";
            $db->query($query);
            $query = sprintf("UPDATE antonyms\n\t\t\tSET word_meaning_id1 = %d\n\t\t\tWHERE word_meaning_id2 = %d", $newWMID, $this_id);
            #print $query."<p>";
            $db->query($query);
        } else {
            print "Internal error: more than one match for {$query}";
            return;
        }
    }
}
示例#25
0
<?php

include_once 'db_connect.php';
include_once 'functions.php';
sec_session_start();
?>

<?php 
if (login_check($mysqli) == true) {
    if (CheckArma3isrunning() == false) {
        echo "Der Server ist schon Offline! Du wirst wieder zum Interface weitergeleitet";
        ?>
		<meta http-equiv="refresh" content="3; URL=http://127.0.0.1/Webinterface_arma.php">
		<?php 
    } else {
        execInBackground("C:\\Bats\\StopArma3.bat");
        echo "Server wird gestoppt, du wirst wieder zum Interface weitergeleitet";
        doLog("Hat den Server Gestoppt");
        ?>
		<meta http-equiv="refresh" content="3; URL=http://127.0.0.1/Webinterface_arma.php">
		<?php 
    }
} else {
    echo 'You are not authorized to access this page, please login.';
    ?>
		<meta http-equiv="refresh" content="3; URL=http://127.0.0.1/index.php">
		<?php 
}
?>

示例#26
0
文件: jobs2.php 项目: royalswe/yas26
                        return false;
                    }
                } else {
                    return false;
                }
            }
            return true;
        } else {
            return false;
        }
    }
    $backup = db_backup();
    if ($jobs['backup'][0] == 7) {
        $jobs['backup'][1] = $plus_week;
    } else {
        if ($jobs['backup'][0] == 30) {
            $jobs['backup'][1] = $plus_month;
        } else {
            $jobs['backup'][1] = $midnight_today;
        }
    }
    $message = $backup === true ? 'successful' : 'failed';
    doLog("Database update " . $message . " - triggered by visitor " . $displayIp);
}
if ($update == 1) {
    $new_jobs = serialize($jobs);
    yasDB_update("UPDATE `settings` SET `jobs` = '{$new_jobs}' WHERE `id` = 1");
    include $setting['sitepath'] . "/includes/settings_function.inc.php";
    createConfigFile();
}
$_SESSION['runjobs'] = 'no-go';
示例#27
0
<?php

include_once 'db_connect.php';
include_once 'functions.php';
sec_session_start();
?>

<?php 
if (login_check($mysqli) == true) {
    if (CheckArma3isrunning() == true) {
        echo "Der Server ist noch Online stoppe erst den Server bevor du ihn Updatest";
        ?>
		<meta http-equiv="refresh" content="3; URL=http://127.0.0.1/Webinterface_arma.php">
		<?php 
    } else {
        execInBackground("C:\\Bats\\UpdateArma3.bat");
        echo "Der Server wird geupdatet, bitte warte 2-3Minuten";
        doLog("Hat den Server Geupdatet");
        ?>
		<meta http-equiv="refresh" content="3; URL=http://127.0.0.1/Webinterface_arma.php">
		<?php 
    }
} else {
    echo 'You are not authorized to access this page, please login.';
    ?>
		<meta http-equiv="refresh" content="3; URL=http://127.0.0.1/index.php">
		<?php 
}