function LogOut() { if (isset($_SESSION["user_id"])) { session_destroy(); LogWrite("Déconnexion"); Redirect("login?message=4"); } }
function ClientDrop($idClient, $O) { $query = "DELETE FROM `client` WHERE `idClient`='{$idClient}';"; QueryExcute('', $query); $user_nom = $_SESSION['user_nom']; $user_prenom = $_SESSION['user_prenom']; NotifAllWrite('', '', '<a href="#">' . $user_nom . ' ' . $user_prenom . ' a supprimé le client, ' . $O->FamilyName . ' ' . $O->FirstName); LogWrite('Suppression de de client ' . $O->FamilyName . ' ' . $O->FirstName); Redirect('ili-modules/client/liste'); }
function UserInsert() { if (isset($_POST['cin']) && isset($_POST['FamilyName']) && isset($_POST['FirstName']) && isset($_POST['Email']) && isset($_POST['Phone']) && isset($_POST['Password']) && isset($_POST['FunctionPost']) && isset($_POST['Adress']) && isset($_POST['BirthDay'])) { //Recup variable $cin = addslashes($_POST['cin']); $FamilyName = addslashes($_POST['FamilyName']); $FirstName = addslashes($_POST['FirstName']); $Email = addslashes($_POST['Email']); $FunctionPost = addslashes($_POST['FunctionPost']); $Phone = addslashes($_POST['Phone']); $Adress = addslashes($_POST['Adress']); $BirthDay = addslashes($_POST['BirthDay']); $Password = addslashes($_POST['Password']); if (isset($_POST['fbAccount'])) { $fbAccount = $_POST['fbAccount']; } else { $fbAccount = ''; } if (isset($_POST['githubAccount'])) { $githubAccount = $_POST['githubAccount']; } else { $githubAccount = ''; } if (isset($_POST['linkedinAccount'])) { $linkedinAccount = $_POST['linkedinAccount']; } else { $linkedinAccount = ''; } if (isset($_POST['img_url'])) { $img_url = $_POST['img_url']; } else { $img_url = ''; } // Function global $Timestamp, $URL; $add_by = $_SESSION['user_nom_prenom']; if (QueryExcute('mysqli_fetch_object', "SELECT * FROM users WHERE idUser='******';")) { Redirect('ili-users/user_add?message=8'); } else { if (QueryExcute('mysqli_fetch_object', "SELECT * FROM users WHERE Email='{$Email}';")) { Redirect('ili-users/user_add?message=9'); } else { QueryExcute("", "INSERT INTO `users` VALUES ('{$cin}', '2', '{$FamilyName}', '{$FirstName}', '{$Email}', '{$FunctionPost}', '{$Phone}', '{$Adress}', '{$BirthDay}', MD5('{$Password}'), '{$Timestamp}', '{$fbAccount}', '{$githubAccount}', '{$linkedinAccount}', '{$ProfilePhoto}', '{$add_by}', '{$Timestamp}')"); QueryExcute("", "INSERT INTO `usersprivilege` VALUES (NULL, '{$cin}', 'USERS', '1', '0', '0', '0'), (NULL, '{$cin}', 'CLIENTS', '1', '0', '0', '0'), (NULL, '{$cin}', 'CONTRAT', '1', '0', '0', '0'), (NULL, '{$cin}', 'CAISSE', '1', '0', '0', '0')"); NotifAllWrite($cin, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $cin . '">Nouveau utilisateur, ' . $FamilyName . ' ' . $FirstName); LogWrite("Creation de l\\'utilisateur : " . $cin); Redirect('ili-users/users'); } } } }
function LogIn($Email, $Password) { if ($o = QueryExcute("mysqli_fetch_object", "SELECT * FROM `users`, `usersrank` WHERE `users`.Email='{$Email}' AND `users`.Password='******' AND `users`.idRank=`usersrank`.idRank")) { if ($o->idRank == '1') { Redirect("login?message=3"); } else { $_SESSION['user_id'] = $o->idUser; $_SESSION['user_nom'] = $o->FamilyName; $_SESSION['user_prenom'] = $o->FirstName; $_SESSION['user_nom_prenom'] = $_SESSION['user_nom'] . ' ' . $_SESSION['user_prenom']; $_SESSION['user_idRank'] = $o->idRank; $_SESSION['user_img'] = $o->ProfilePhoto; LogWrite("Connexion"); Redirect("index"); } } else { Redirect("login?message=2"); } }
function ClientInsert() { //Form Variables if (isset($_POST['idClient']) && isset($_POST['FamilyName']) && isset($_POST['FirstName']) && isset($_POST['Phone']) && isset($_POST['Adress'])) { global $URL; $idClient = addslashes($_POST['idClient']); $FamilyName = addslashes($_POST['FamilyName']); $FirstName = addslashes($_POST['FirstName']); $Phone = addslashes($_POST['Phone']); $Adress = addslashes($_POST['Adress']); $idUser = $_SESSION['user_id']; $User = $_SESSION['user_nom_prenom']; if (QueryExcute("mysqli_fetch_row", "SELECT * FROM client WHERE idClient='{$idClient}'") == 0) { QueryExcute("", "INSERT INTO `client` VALUES ('{$idClient}', '{$FamilyName}', '{$FirstName}', '{$Phone}', '{$Adress}', '{$idUser}');"); NotifAllWrite('', '', '<a href="' . $URL . 'ili-modules/client/client?id=' . $idClient . '">' . $User . ' a creé un nouveau client , ' . $FamilyName . ' ' . $FirstName); LogWrite("Création de client : <a href=\"ili-modules/client/client?id=" . $idClient . "\">" . $idClient . "</a>"); Redirect('ili-modules/client/client?id=' . $idClient); } else { Redirect('ili-modules/client/add?message=16'); } } }
function getEvent($str) { //format: EVENT <subscribe-no> <seq-no> Key1 "Value1" Key2 "Value2" ... //Result: associative array // b[Key1] = Value1 ... $a = strposall($str, " "); $start = $a[2] + 1; $b = array(); $end = strlen($str); $i = $start; while ($i < $end) { $e = strpos($str, " ", $i); $key = substr($str, $i, $e - $i); $i = $e + 2; $e = strpos($str, "\"", $i); $value = substr($str, $i, $e - $i); $i = $e + 2; $b[$key] = $value; } LogWrite("getEvent: " . print_r($b, true)); return $b; }
<?php include "../ili-functions/functions.php"; function UserDiplomaDrop($idDiploma) { $query = "DELETE FROM `usersdiploma` WHERE `idDiploma`='{$idDiploma}';"; if (QueryExcute('', $query)) { return 1; } } Authorization('2'); UserDiplomaDrop($_GET['id_diploma']); $idUser = $_GET['idUser']; $diploma_name = $_GET['diploma_name']; $user = UserGetInfo($idUser); if ($user == '') { Redirect('index?message=14'); } else { $idUserSession = $_SESSION['user_id']; if ($idUserSession == $idUser) { NotifAllWrite($idUser, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $idUser . '">' . $user->FamilyName . ' ' . $user->FirstName . ' a supprimé son diplôme : ' . $diploma_name); } else { $UserUpdated = UserGetInfo($idUser); $UserUpdater = UserGetInfo($idUserSession); NotifAllWrite($idUser, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $idUser . '">' . $UserUpdater->FamilyName . ' ' . $UserUpdater->FirstName . ' a supprimer le diplôme : ' . $diploma_name . ' de ' . $UserUpdated->FamilyName . ' ' . $UserUpdated->FirstName); } LogWrite("Suppression du diplome : " . $diploma_name . ", de l\\'utilisateur : " . $idUser); Redirect('ili-users/user_edit?id=' . $idUser); }
{ foreach ($this->clients as $client) { call_user_func(array($client, $func), $v1, $v2, $v3, $v4); } } } SetLogFile(dirname($argv[0]) . "/logfile.txt"); LogWrite("############################## Restarted ######################################"); $serverState = ServerState::getInstance(); //LogWrite($serverState->dump()); $LS1 = new LPECListeningSocket($LINN_HOST, $LINN_PORT, 'LPECClientSocket', $serverState, 30000); $LS2 = new LinnDSListeningSocket(0, 9050, 'LinnDSClientSocket', $serverState, 30000); $LS2->setLPECListeningSocket($LS1); //$LS3 = new LinnDSwsListeningSocket(0, 9051, 'LinnDSClientSocket', $serverState, 30000); //$LS3->setLPECListeningSocket($LS1); //$LS1->dump(); //$LS2->dump(); //$LS3->dump(); $SS = new SocketServer(); $SS->addListeningSocket($LS1); $SS->addListeningSocket($LS2); //$SS->addListeningSocket($LS3); LogWrite("LinnDS-jukebox-daemon starts..."); try { $SS->run(); } catch (Exception $e) { LogWrite($e->getMessage()); } ?>
public function DeleteSequence() { $result = $this->DeleteSequenceStmt()->execute(); $r = $this->changes(); LogWrite("DeleteSequence: -> {$r}"); $this->DeleteSequenceStmt()->reset(); }
function InsertDIDL_list($musicDB, $Preset, $TrackSeq, $AfterId) { global $State; global $NL; $DIDL_URL = $musicDB->PresetURL($Preset); $Res = true; LogWrite("InsertDIDL_list: " . $DIDL_URL . ", " . $TrackSeq . ", " . $AfterId); $xml = simplexml_load_file($DIDL_URL); $xml->registerXPathNamespace('didl', 'urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/'); $URLs = $xml->xpath('//didl:res'); $DIDLs = $xml->xpath('//didl:DIDL-Lite'); if ($TrackSeq == 0) { $musicDB->InsertQueue(-1, $Preset, 1, PrepareXML($URLs[0][0]), PrepareXML($DIDLs[0]->asXML())); if (Send("ACTION Ds/Playlist 1 Insert \"" . $AfterId . "\" \"" . PrepareXML($URLs[0][0]) . "\" \"" . PrepareXML($DIDLs[0]->asXML()) . "\"") == false) { $Res = false; } if (Play() == false) { $Res = false; } for ($i = 1; $i < sizeof($URLs); $i++) { $musicDB->InsertQueue(-1, $Preset, $i + 1, PrepareXML($URLs[$i][0]), PrepareXML($DIDLs[$i]->asXML())); if (Send("ACTION Ds/Playlist 1 Insert \"%NewId%\" \"" . PrepareXML($URLs[$i][0]) . "\" \"" . PrepareXML($DIDLs[$i]->asXML()) . "\"") == false) { $Res = false; } } } else { $No = $TrackSeq - 1; $musicDB->InsertQueue(-1, $Preset, $TrackSeq, PrepareXML($URLs[$No][0]), PrepareXML($DIDLs[$No]->asXML())); if (Send("ACTION Ds/Playlist 1 Insert \"" . $AfterId . "\" \"" . PrepareXML($URLs[$No][0]) . "\" \"" . PrepareXML($DIDLs[$No]->asXML()) . "\"") == false) { $Res = false; } if (Play() == false) { $Res = false; } } IncrRevNo($musicDB); return $Res; }
<?php include "../ili-functions/functions.php"; function UserDrop($id) { QueryExcute('', "DELETE FROM usersprivilege WHERE idUser='******'"); QueryExcute('', "DELETE FROM users WHERE idUser='******'"); } Authorization('2'); AuthorizedPrivileges('USERS', 'D'); $id = $_GET['id']; if (!$IfUserHasActivity) { UserDrop($id); NotifAllWrite($id, '', 'L`utilisateur avec CIN :' . $id . ' a été supprimer'); LogWrite("Suppression de l`utilisateur avec CIN=" . $id); Refresh('index'); } else { Redirect('index?message=39'); }
<?php include "../ili-functions/functions.php"; function UserExpiranceDrop($idExperience) { $query = "DELETE FROM `usersexperience` WHERE `idExperience`='{$idExperience}';"; if (QueryExcute('', $query)) { return 1; } } Authorization('2'); UserExpiranceDrop($_GET['id_expirance']); $company = $_GET['Company']; $idUser = $_GET['idUser']; $user = UserGetInfo($idUser); if ($user == '') { Redirect('index?message=14'); } else { $idUserSession = $_SESSION['user_id']; if ($idUserSession == $idUser) { NotifAllWrite($idUser, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $idUser . '">' . $user->FamilyName . ' ' . $user->FirstName . ' a supprimé expérance dans l`etablissement : ' . $company); } else { $UserUpdated = UserGetInfo($idUser); $UserUpdater = UserGetInfo($idUserSession); NotifAllWrite($idUser, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $idUser . '">' . $UserUpdater->FamilyName . ' ' . $UserUpdater->FirstName . ' a supprimer l`experiance dans l`etablissement : ' . $company . ' de ' . $UserUpdated->FamilyName . ' ' . $UserUpdated->FirstName); } LogWrite("Suppression du l\\'experience : " . $company . ", de l\\'utilisateur : " . $idUser); Redirect('ili-users/user_edit?id=' . $idUser); }
function UploadImage() { global $URL; $idUser = $_SESSION['user_id']; $user = UserGetInfo($idUser); if (isset($_POST["UploadImage"])) { $target_dir = "../../ili-upload/"; $target_file = $target_dir . basename($_FILES["fileToUpload"]['name']); $uploadOk = 1; $imageFileType = pathinfo($target_file, PATHINFO_EXTENSION); $imageFilename = pathinfo($target_file, PATHINFO_FILENAME); $imageNewName = "logo"; $NewTarget = $target_dir . $imageNewName . '.' . $imageFileType; // Check if image file is a actual image or fake image $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); if ($check !== false) { /*echo "Ce fichier est une image - " . $check["mime"] . ".";*/ $uploadOk = 1; } else { echo "Ce fichier n'est pas une image."; $uploadOk = 0; } // Check if file already exists /*if (file_exists($target_file)) { echo "Fichier existe déjà."; $uploadOk = 0; }*/ // Check file size if ($_FILES["fileToUpload"]["size"] > 500000) { echo "Le fichier est volumineux."; $uploadOk = 0; } // Allow certain file formats if ($imageFileType != "png") { echo "L'extension PNG uniquement est autorisé."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Erreur : Chargement!."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $NewTarget)) { /*echo "Fichier ". basename( $_FILES["fileToUpload"]["name"]). " Chargé.";*/ NotifAllWrite('', '', '<a href="' . $URL . 'ili-modules/ets/info">' . $user->FamilyName . ' ' . $user->FirstName . ', a modifier le logo de l`entreprise'); LogWrite("Modification de logo de l\\'entreprise"); Redirect('ili-modules/ets/info'); } else { echo "Erreur : Chargement!."; } } } }
function UserPrivilegesGetUpdate($idUser) { global $URL; $user = UserGetInfo($idUser); if ($_SESSION['user_idRank'] >= 3 && $_SESSION['user_id'] != $idUser) { echo ' <ul class="nav nav-tabs nav-stacked" style="margin-left:-15%;"> <div class="widget-body"> <div class="space10"></div> <ul id="tree_2" class="tree"> <li> <a data-toggle="branch" class="tree-toggle" data-role="branch" href="#">Autorisations</a> <ul class="branch in">'; $query = "SELECT `bloc` FROM `usersprivilege` WHERE `idUser`='{$idUser}'"; $result = QueryExcuteWhile($query); while ($o = mysqli_fetch_object($result)) { if ($o->bloc != 'CONTRAT' && $o->bloc != 'CAISSE') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $query2 = "SELECT * FROM `usersprivilege` WHERE `idUser`='{$idUser}' AND `bloc`='{$o->bloc}';"; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch"> '; if ($b->s) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 's0" value="1"> <input type="checkbox" name="s0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-eye-open"></p></a> Voir </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 's1" value="1" onChange="this.form.submit()"> <a><p class="icon-eye-open"></p></a> Voir </form> </li> '; } if ($b->c) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'c0" value="1"> <input type="checkbox" name="c0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-plus"></p></a> Créer </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'c1" value="1" onChange="this.form.submit()"> <a><p class="icon-plus"></p></a> Créer </form> </li> '; } if ($b->u) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'u0" value="1"> <input type="checkbox" name="u0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-edit"></p></a> Modifier </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'u1" value="1" onChange="this.form.submit()"> <a><p class="icon-edit"></p></a> Modifier </form> </li> '; } if ($b->d) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'd0" value="1"> <input type="checkbox" name="d0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-trash"></p></a> Supprimer </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'd1" value="1" onChange="this.form.submit()"> <a><p class="icon-trash"></p></a> Supprimer </form> </li> '; } if (isset($_POST[$b->idPrivilege . 's0'])) { $query = "UPDATE `usersprivilege` SET s='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>VOIR</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 's1'])) { $query = "UPDATE `usersprivilege` SET s='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>VOIR</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c0'])) { $query = "UPDATE `usersprivilege` SET c='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>CREER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c1'])) { $query = "UPDATE `usersprivilege` SET c='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>CREER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u0'])) { $query = "UPDATE `usersprivilege` SET u='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>MODIFIER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege MODIFIER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u1'])) { $query = "UPDATE `usersprivilege` SET u='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>MODIFIER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege MODIFIER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'd0'])) { $query = "UPDATE `usersprivilege` SET d='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Suppression du privilége <strong>SUPPRIMER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege SUPPRIMER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'd1'])) { $query = "UPDATE `usersprivilege` SET d='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>SUPPRIMER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege SUPPRIMER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } echo ' </ul> '; } } if ($o->bloc == 'CONTRAT') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $query2 = "SELECT * FROM `usersprivilege` WHERE `idUser`='{$idUser}' AND `bloc`='{$o->bloc}';"; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch"> '; if ($b->s) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 's0" value="1"> <input type="checkbox" name="s0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-eye-open"></p></a> Voir </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 's1" value="1" onChange="this.form.submit()"> <a><p class="icon-eye-open"></p></a> Voir </form> </li> '; } if ($b->c) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'c0" value="1"> <input type="checkbox" name="c0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-file"></p></a> Créer </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'c1" value="1" onChange="this.form.submit()"> <a><p class="icon-file"></p></a> Créer </form> </li> '; } if ($b->u) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'u0" value="1"> <input type="checkbox" name="u0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-repeat"></p></a> Renouveler </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'u1" value="1" onChange="this.form.submit()"> <a><p class="icon-repeat"></p></a> Renouveler </form> </li> '; } if ($b->d) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'd0" value="1"> <input type="checkbox" name="d0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-trash"></p></a> Supprimer </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'd1" value="1" onChange="this.form.submit()"> <a><p class="icon-trash"></p></a> Supprimer </form> </li> '; } if (isset($_POST[$b->idPrivilege . 's0'])) { $query = "UPDATE `usersprivilege` SET s='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>VOIR</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 's1'])) { $query = "UPDATE `usersprivilege` SET s='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>VOIR</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c0'])) { $query = "UPDATE `usersprivilege` SET c='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>CREER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c1'])) { $query = "UPDATE `usersprivilege` SET c='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>CREER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u0'])) { $query = "UPDATE `usersprivilege` SET u='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>RENOUVELER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege RENOUVELER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u1'])) { $query = "UPDATE `usersprivilege` SET u='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>RENOUVELER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege RENOUVELER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'd0'])) { $query = "UPDATE `usersprivilege` SET d='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Suppression du privilége <strong>SUPPRIMER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege SUPPRIMER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'd1'])) { $query = "UPDATE `usersprivilege` SET d='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>SUPPRIMER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege SUPPRIMER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } echo ' </ul> '; } } if ($o->bloc == 'CAISSE') { echo ' <li><a data-toggle="branch" class="tree-toggle closed" data-role="branch" href="#">' . $o->bloc . '</a>'; $query2 = "SELECT * FROM `usersprivilege` WHERE `idUser`='{$idUser}' AND `bloc`='{$o->bloc}';"; $result2 = QueryExcuteWhile($query2); while ($b = mysqli_fetch_object($result2)) { echo ' <ul class="branch"> '; if ($b->s) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 's0" value="1"> <input type="checkbox" name="s0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-book"></p></a> Journal </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 's1" value="1" onChange="this.form.submit()"> <a><p class="icon-book"></p></a> Journal </form> </li> '; } if ($b->c) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'c0" value="1"> <input type="checkbox" name="c0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-signout"></p></a> Décaissement </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'c1" value="1" onChange="this.form.submit()"> <a><p class="icon-signout"></p></a> Décaissement </form> </li> '; } if ($b->u) { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="hidden" name="' . $b->idPrivilege . 'u0" value="1"> <input type="checkbox" name="u0" value="0" checked onChange="this.form.submit()"> <a><p class="icon-money"></p></a> Echéancier </form> </li> '; } else { echo ' <li> <form action="" method="post" style="margin-bottom:-2px;"> <input type="checkbox" name="' . $b->idPrivilege . 'u1" value="1" onChange="this.form.submit()"> <a><p class="icon-money"></p></a> Echéancier </form> </li> '; } if (isset($_POST[$b->idPrivilege . 's0'])) { $query = "UPDATE `usersprivilege` SET s='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>JOURNAL</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 's1'])) { $query = "UPDATE `usersprivilege` SET s='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>JOURNAL</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege VOIR sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c0'])) { $query = "UPDATE `usersprivilege` SET c='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>DECAISSEMENT</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'c1'])) { $query = "UPDATE `usersprivilege` SET c='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>DECAISSEMENT</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege CREER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u0'])) { $query = "UPDATE `usersprivilege` SET u='0' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Supprission du privilége <strong>ECHEANCIER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Suppression de privilege RENOUVELER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } if (isset($_POST[$b->idPrivilege . 'u1'])) { $query = "UPDATE `usersprivilege` SET u='1' WHERE idPrivilege='{$b->idPrivilege}';"; QueryExcute('', $query); NotifAllWrite('', '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $user->idPrivilege_user . '">Ajout du privilége <strong>ECHEANCIER</strong> sur le bloc <strong>' . $o->bloc . '</strong> de ' . $user->FamilyName . ' ' . $user->FirstName); LogWrite("Ajout de privilege RENOUVELER sur le bloc " . $o->bloc . " pour l\\'utilisateur : " . $idUser); echo '<SCRIPT LANGUAGE="JavaScript">document.location.href="user_edit?id=' . $idUser . '"</SCRIPT>'; } echo ' </ul> '; } } echo ' </li> '; } echo ' </ul> </li> </ul> </div> </ul> '; } }
} else { $TransferDate = ''; } $idUser = $_SESSION['user_id']; $ajout = QueryExcute("", "INSERT INTO `insurancecontract` VALUES ('{$idContract}', '{$idClient}', '{$TypeContract}', '{$NatureContract}');"); if (!$ajout) { $ajout2 = QueryExcute("", "INSERT INTO `payment` VALUES (NULL, '{$EncashmentDate}', '', '{$PaymentKind}', '{$PaymentCode}', '{$Bank}', '{$TransferDate}', '{$Amount}', '{$idUser}');"); if (!$ajout2) { $ObjectPayement = QueryExcute("mysqli_fetch_array", "SELECT max(`idPayment`) FROM `payment`"); if ($ObjectPayement) { $idPayment = $ObjectPayement[0]; $ajout3 = QueryExcute("", "INSERT INTO `contractcycle` VALUES(NULL, '{$idPayment}', '{$idContract}', '{$StartDate}', '{$EndDate}', '{$idUser}');"); if (!$ajout3) { $user = UserGetInfo($idUser); NotifAllWrite('', '', '<a href="' . $URL . 'ili-modules/contrat/contrat?id=' . $idContract . '">' . $user->FamilyName . ' ' . $user->FirstName . ', a crée un nouveau contrat : #' . $idContract . '</a>'); LogWrite("Ajout contract ID : " . $idContract); Redirect("ili-modules/contrat/liste"); } else { Redirect('ili-modules/contrat/add/add?clt=' . $id_clt . '&message=26'); } } else { Redirect('ili-modules/contrat/add/add?clt=' . $id_clt . '&message=27'); } } else { Redirect('ili-modules/contrat/add/add?clt=' . $id_clt . '&message=28'); } } else { Redirect('ili-modules/contrat/add/add?clt=' . $id_clt . '&message=29'); } } ?>
<?php include "../ili-functions/functions.php"; function UserQualificationDrop($idQualification) { $Query = "DELETE FROM `usersqualification` WHERE `idQualification`='{$idQualification}';"; QueryExcute('', $Query); } Authorization('2'); $id_skills = $_GET['id_skills']; $skills_name = $_GET['skills_name']; $idUser = $_GET['idUser']; UserQualificationDrop($id_skills); $user = UserGetInfo($idUser); if ($user == '') { Redirect('index?message=14'); } else { $idUserSession = $_SESSION['user_id']; if ($idUserSession == $idUser) { NotifAllWrite($idUser, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $idUser . '">' . $user->FamilyName . ' ' . $user->FirstName . ' a supprimé son compétance : ' . $skills_name); } else { $UserUpdated = UserGetInfo($idUser); $UserUpdater = UserGetInfo($idUserSession); NotifAllWrite($idUser, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $idUser . '">' . $UserUpdater->FamilyName . ' ' . $UserUpdater->FirstName . ' a supprimer la compétance : ' . $skills_name . ' de ' . $UserUpdated->FamilyName . ' ' . $UserUpdated->FirstName); } LogWrite("Suppression du competence : " . $skills_name . " de l\\'utilisateur : " . $idUser); Redirect('ili-users/user_edit?id=' . $idUser); }
public function setStateArray($name, $subName, $value) { $this->State[$name][$subName] = $value; LogWrite("ServerState:setStateArray[{$name}][{$subName}]={$value}"); }
<?php include "../../../ili-functions/functions.php"; if ($_POST) { //Récupération des variable depuis le lien $idClient = $_GET['idClient']; $Notification = $_GET['Notification']; $Log = $_GET['Log']; $Form = $_GET['Form']; //Récupération des varibales depuis la formulaire $input = $_POST['input']; //Exécution de requette QueryExcute("", "UPDATE `client` SET {$Form} = '{$input}' WHERE `idClient` = '{$idClient}';"); //Récupération des variables pour le log & notification $idUser = $_SESSION['user_id']; //Construction des objets pour le log & notification $User = UserGetInfo($idUser); $Client = ClientGetInfo($idClient); //Execution des fonctions NotifAllWrite('', '', '<a href="' . $URL . 'ili-modules/client/client?id=' . $idClient . '"><b>' . $User->FamilyName . ' ' . $User->FirstName . '</b> ' . $Notification . ' <b>' . $input . '</b>'); LogWrite($Log . ' ' . $input); }
function Logout() { $this->UpdateHistory(0); $this->SaveSession(); if (!($row = $this->db->Query_Fetch_Assoc("SELECT uid, INET_NTOA(ip) as ip, sessid " . "FROM users_online " . "WHERE id=" . $_SESSION[S_ID]["online_table_id"] . " " . "LIMIT 0,1"))) { LogWrite(USERS_LOG, "ненайдена сессия для " . $this->login . ", в подключенных пользователях"); return; } if ($row["uid"] != $this->id) { LogWrite(USERS_LOG, "для пользователя " . $this->login . " в сессии " . $_REQUEST["PHPSESSID"] . " не совпадает id пользователя (" . $row["uid"] . ")"); } if ($row["ip"] != $_SESSION[S_ID]["ip_login"]) { LogWrite(USERS_LOG, "для пользователя " . $this->login . " в сессии " . $_REQUEST["PHPSESSID"] . " не совпадает ip (" . $_SESSION[S_ID]["ip_login"] . " - " . $row["ip_login"] . ")"); } if ($row["sessid"] != $_REQUEST["PHPSESSID"]) { LogWrite(USERS_LOG, "для пользователя " . $this->login . " не совпадают сессии " . $_REQUEST["PHPSESSID"] . " и " . $row["sessid"]); } $this->db->Query("DELETE FROM users_online WHERE id=" . $_SESSION[S_ID]["online_table_id"]); $user = new System_User($this->db); // проверяем есть ли в списке залогиненых этот же пользователь? если есть, и последняя активность более 24 часов, то удаляем запись if (!($result = $this->db->Query_Fetch("SELECT id, uid, TIMEDIFF(NOW(), time_last_active)+0 as time, inet_ntoa(ip) as ip, time_login, time_last_active " . "FROM users_online "))) { return; } // чистим таблицу с давно законнекчиными foreach ($result as $row) { if ($row["time"] < SESSION_HOURS) { continue; } $this->db->Query("INSERT INTO users_connection_history (uid, ip, time_active, state) " . "VALUES ('" . $row["uid"] . "', inet_aton('" . $row["ip"] . "'), '" . $row["time_last_active"] . "', 0)"); $this->db->Query("DELETE FROM users_online WHERE id=" . $row["id"]); $user->Reset($row["uid"]); LogWrite(USERS_LOG, "из залогиненых пользователей была удалена старая запись пользователя " . $user->login . ", " . "от " . $row["time_login"] . " (IP: " . $row["ip"] . ")"); } // чистим старые кешы ClearCache(); }
public function processMessage($message) { LogWrite("LPECClientSocket::processMessage - {$message}"); $DataHandled = false; if ($DEBUG > 1) { LogWrite($message); } if (strpos($message, "ALIVE Ds") !== false) { $this->Send("SUBSCRIBE Ds/Product"); $DataHandled = true; } elseif (strpos($message, "ALIVE") !== false) { LogWrite("ALIVE ignored : " . $message); $DataHandled = true; } elseif (strpos($message, "ERROR") !== false) { LogWrite("ERROR ignored : " . $message); $DataHandled = true; } elseif (strpos($message, "SUBSCRIBE") !== false) { // SUBSCRIBE are sent by Linn when a SUBSCRIBE finishes, thus // we send the possible next command (Send) after removing // previous command. // We record the Number to Subscribe action in the array to // help do less work with the events. $front = array_shift($this->Queue); if ($DEBUG > 1) { LogWrite("Command: " . $front . " -> " . $message); } $S1 = substr($front, 10); $S2 = substr($message, 10); $this->SubscribeType[$S1] = $S2; $this->Send(""); $DataHandled = true; } elseif (strpos($message, "RESPONSE") !== false) { // RESPONSE are sent by Linn when an ACTION finishes, thus we // send the possible next command (Send) after removing // previous command. $front = array_shift($this->Queue); if ($DEBUG > 0) { LogWrite("Command: " . $front . " -> " . $message); } if (strpos($front, "ACTION Ds/Product 1 Source ") !== false) { //ACTION Ds/Product 1 Source \"(\d+)\" //RESPONSE \"([[:ascii:]]+?)\" \"([[:ascii:]]+?)\" \"([[:ascii:]]+?)\" \"([[:ascii:]]+?)\" $F = getParameters($front); $D = getParameters($message); //$State['Source_SystemName'][$F[0]] = $D[0]; //$State['Source_Type'][$F[0]] = $D[1]; //$State['Source_Name'][$F[0]] = $D[2]; //$State['Source_Visible'][$F[0]] = $D[3]; $this->getState()->setStateArray('SourceName', $D[2], $F[0]); if ($D[1] == "Playlist") { // We have the Playlist service. subscribe... $this->Send("SUBSCRIBE Ds/Playlist"); //$this->Send("SUBSCRIBE Ds/Jukebox"); } elseif ($D[1] == "Radio") { // We have the Radio service. subscribe... //$this->Send("SUBSCRIBE Ds/Radio"); } } elseif (strpos($front, "ACTION Ds/Playlist 1 Read ") !== false) { //ACTION Ds/Playlist 1 Read \"(\d+)\" //RESPONSE \"([[:ascii:]]+?)\" \"([[:ascii:]]+?)\" $F = getParameters($front); $D = getParameters($message); $this->getState()->setStateArray('PlaylistURLs', $F[0], $D[0]); $this->getState()->setStateArray('PlaylistXMLs', $F[0], $D[1]); $musicDB = new MusicDB(); $musicDB->UpdateQueue($F[0], -1, -1, $D[0], $D[1]); $musicDB->close(); } elseif (strpos($front, "ACTION Ds/Playlist 1 Insert ") !== false) { //ACTION Ds/Playlist 1 Insert \"(\d+)\" \"([[:ascii:]]+?)\" \"([[:ascii:]]+?)\" //RESPONSE \"([[:ascii:]]+?)\" $F = getParameters($front); $D = getParameters($message); $this->getState()->setState('NewId', $D[0]); $this->getState()->setStateArray('PlaylistURLs', $D[0], $F[1]); $this->getState()->setStateArray('PlaylistXMLs', $D[0], $F[2]); $musicDB = new MusicDB(); $musicDB->UpdateQueue($D[0], -1, -1, $F[1], $F[2]); $musicDB->close(); } elseif (strpos($front, "ACTION Ds/Playlist 1 IdArray") !== false) { //ACTION Ds/Playlist 1 IdArray //RESPONSE \"([[:ascii:]]+?)\" \"([[:ascii:]]+?)\" $F = getParameters($front); $D = getParameters($message); $this->getState()->setState('IdArray_Token', $D[0]); $this->getState()->setState('IdArray_base64', $D[1]); $this->getState()->setState('IdArray', unpack("N*", base64_decode($D[1]))); $musicDB = new MusicDB(); $this->CheckPlaylist($musicDB); $musicDB->close(); } $this->Send(""); $DataHandled = true; } elseif (strpos($message, "EVENT ") !== false) { // EVENTs are sent by Your linn - those that were subscribed // to. We think the below ones are interesting.... $E = getEvent($message); if (strpos($message, "EVENT " . $this->SubscribeType['Ds/Product']) !== false) { if (strpos($message, "SourceIndex ") !== false) { $this->getState()->setState('SourceIndex', $E[SourceIndex]); } if (strpos($message, "ProductModel ") !== false) { $this->getState()->setState('ProductModel', $E[ProductModel]); } if (strpos($message, "ProductName ") !== false) { $this->getState()->setState('ProductName', $E[ProductName]); } if (strpos($message, "ProductRoom ") !== false) { $this->getState()->setState('ProductRoom', $E[ProductRoom]); } if (strpos($message, "ProductType ") !== false) { $this->getState()->setState('ProductType', $E[ProductType]); } if (strpos($message, "Standby ") !== false) { $this->getState()->setState('Standby', $E[Standby]); $musicDB = new MusicDB(); $musicDB->SetState("Standby", $E[Standby]); $musicDB->close(); } if (strpos($message, "ProductUrl ") !== false) { $this->getState()->setState('ProductUrl', $E[ProductUrl]); } if (strpos($message, "Attributes ") !== false) { $this->getState()->setState('Attributes', $E[Attributes]); if (strpos($E[Attributes], "Volume") !== false) { $this->Send("SUBSCRIBE Ds/Volume"); } if (strpos($E[Attributes], "Info") !== false) { //$this->Send("SUBSCRIBE Ds/Info"); } if (strpos($E[Attributes], "Time") !== false) { //$this->Send("SUBSCRIBE Ds/Time"); } } if (strpos($message, "SourceCount ") !== false) { for ($i = 0; $i < $E[SourceCount]; $i++) { $this->Send("ACTION Ds/Product 1 Source \"" . $i . "\""); } } $DataHandled = true; } elseif (strpos($message, "EVENT " . $this->SubscribeType['Ds/Playlist']) !== false) { if (strpos($message, "TransportState ") !== false) { $this->getState()->setState('TransportState', $E[TransportState]); $musicDB = new MusicDB(); $musicDB->SetState("TransportState", $E[TransportState]); $musicDB->close(); } if (strpos($message, "Id ") !== false) { $this->getState()->setState('Id', $E[Id]); $musicDB = new MusicDB(); $musicDB->SetState("LinnId", $E[Id]); $musicDB->close(); } if (strpos($message, "IdArray ") !== false) { $this->getState()->setState('IdArray_base64', $E[IdArray]); $this->getState()->setState('IdArray', unpack("N*", base64_decode($E[IdArray]))); $musicDB = new MusicDB(); $this->CheckPlaylist($musicDB); $musicDB->close(); } if (strpos($message, "Shuffle ") !== false) { $this->getState()->setState('Shuffle', $E[Shuffle]); } if (strpos($message, "Repeat ") !== false) { $this->getState()->setState('Repeat', $E[Repeat]); } if (strpos($message, "TrackDuration ") !== false) { $this->getState()->setState('TrackDuration', $E[TrackDuration]); } if (strpos($message, "TrackCodecName ") !== false) { $this->getState()->setState('TrackCodecName', $E[TrackCodecName]); } if (strpos($message, "TrackSampleRate ") !== false) { $this->getState()->setState('TrackSampleRate', $E[TrackSampleRate]); } if (strpos($message, "TrackBitRate ") !== false) { $this->getState()->setState('TrackBitRate', $E[TrackBitRate]); } if (strpos($message, "TrackLossless ") !== false) { $this->getState()->setState('TrackLossless', $E[TrackLossless]); } $DataHandled = true; } elseif (strpos($message, "EVENT " . $this->SubscribeType['Ds/Volume']) !== false) { if (strpos($message, "Volume ") !== false) { LogWrite("Event Volume"); $this->getState()->setState('Volume', $E[Volume]); $musicDB = new MusicDB(); $musicDB->SetState("Volume", $E[Volume]); $musicDB->close(); } if (strpos($message, "Mute ") !== false) { $this->getState()->setState('Mute', $E[Mute]); $musicDB = new MusicDB(); $musicDB->SetState("Mute", $E[Mute]); $musicDB->close(); } $DataHandled = true; } elseif (strpos($message, "EVENT " . $this->SubscribeType['Ds/Jukebox']) !== false) { if (strpos($message, "CurrentPreset ") !== false) { $this->getState()->setState('CurrentPreset', $E[CurrentPreset]); } if (strpos($message, "CurrentBookmark ") !== false) { $this->getState()->setState('CurrentBookmark', $E[CurrentBookmark]); } $DataHandled = true; } else { LogWrite("UNKNOWN : " . $message); $DataHandled = true; } } return $DataHandled; }
public function processMessage($message) { LogWrite("LinnDSClientSocket::processMessage - {$message}"); $DataHandled = false; if ($DEBUG > 1) { LogWrite($message); } if (strpos($message, "Jukebox") !== false) { // Here things happens - we execute the actions sent from the // application, by issuing a number of ACTIONs. $D = getParameters($message); if (strpos($message, "Jukebox PlayNow ") !== false) { //Jukebox PlayNow \"(\d+)\" \"(\d+)\" $JukeBoxPlay = $D[0]; $JukeBoxTrack = $D[1]; LogWrite("JukeBoxPlayNow: " . $JukeBoxPlay . ", " . $JukeBoxTrack); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('SelectPlaylist') == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Stop') == false) { $Continue = false; } $musicDB = new MusicDB(); if ($this->listeningSocket->getLPECListeningSocket()->CallClients1('DeleteAll', $musicDB) == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $JukeBoxPlay, $JukeBoxTrack, 0) == false) { $Continue = false; } $musicDB->close(); //Send("ACTION Ds/Jukebox 3 SetCurrentPreset \"" . $JukeBoxPlay . "\""); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 IdArray") == false) { $Continue = false; } $DataHandled = true; } elseif (strpos($message, "Jukebox PlayNext ") !== false) { //Jukebox PlayNext \"(\d+)\" \"(\d+)\" $JukeBoxPlay = $D[0]; $JukeBoxTrack = $D[1]; LogWrite("JukeBoxPlayNext: " . $JukeBoxPlay . ", " . $JukeBoxTrack); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('SelectPlaylist') == false) { $Continue = false; } $musicDB = new MusicDB(); if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $JukeBoxPlay, $JukeBoxTrack, $this->getState()->getState('Id')) == false) { $Continue = false; } $musicDB->close(); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 IdArray") == false) { $Continue = false; } if ($DEBUG > 0) { //LogWrite($message); //print_r($State); } $DataHandled = true; } elseif (strpos($message, "Jukebox PlayLater ") !== false) { //Jukebox PlayLater \"(\d+)\" \"(\d+)\" $JukeBoxPlay = $D[0]; $JukeBoxTrack = $D[1]; LogWrite("JukeBoxPlayLater: " . $JukeBoxPlay . ", " . $JukeBoxTrack); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('SelectPlaylist') == false) { $Continue = false; } $musicDB = new MusicDB(); if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $JukeBoxPlay, $JukeBoxTrack, end($this->getState()->getState('IdArray'))) == false) { $Continue = false; } $musicDB->close(); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) { $Continue = false; } $this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 IdArray"); if ($DEBUG > 0) { //LogWrite($message); //print_r($State); } $DataHandled = true; } elseif (strpos($message, "Jukebox PlayRandomTracks ") !== false) { //Jukebox PlayRandomTracks \"(\d+)\" \"(\d+)\" $JukeBoxFirstAlbum = $D[0]; $JukeBoxLastAlbum = $D[1]; LogWrite("JukeBoxPlayRandomTracks: " . $JukeBoxFirstAlbum . ", " . $JukeBoxLastAlbum); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('SelectPlaylist') == false) { $Continue = false; } $musicDB = new MusicDB(); if ($this->getState()->getState('TransportState') == "Stopped") { if ($this->listeningSocket->getLPECListeningSocket()->CallClients1('DeleteAll', $musicDB) == false) { $Continue = false; } } for ($i = 0; $i < 50; $i++) { $RandomPreset = rand($JukeBoxFirstAlbum, $JukeBoxLastAlbum); $RandomTrack = rand(1, $musicDB->NumberOfTracks($RandomPreset)); if ($i == 0) { if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $RandomPreset, $RandomTrack, end($this->getState()->getState('IdArray'))) == false) { $Continue = false; } } else { if ($this->listeningSocket->getLPECListeningSocket()->CallClients4('InsertDIDL_list', $musicDB, $RandomPreset, $RandomTrack, "%NewId%") == false) { $Continue = false; } } } $musicDB->close(); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) { $Continue = false; } $this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 IdArray"); if ($DEBUG > 0) { //LogWrite($message); //print_r($State); } $DataHandled = true; } } elseif (strpos($message, "Volume") !== false) { $D = getParameters($message); // Here things happens - we execute the actions sent from the // application, by issuing a number of ACTIONs. if (strpos($message, "Volume Set ") !== false) { //Volume Set \"(\d+)\" $value = $D[0]; if ($value > $this->getState()->getState('MAX_VOLUME')) { $value = $this->getState()->getState('MAX_VOLUME'); } if ($value != $this->getState()->getState('Volume') && $value != "") { LogWrite("VolumeSet: " . $value); if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 SetVolume \"" . $value . "\"") == false) { $Continue = false; } $this->getState()->setState('Volume', $value); } $DataHandled = true; } elseif (strpos($message, "Volume Incr5") !== false) { //Volume Incr5 if ($this->getState()->getState('Volume') < $this->getState()->getState('MAX_VOLUME') - 5) { LogWrite("VolumeIncr5: "); $value = $this->getState()->getState('Volume'); $value = $value + 5; if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) { $Continue = false; } $this->getState()->setState('Volume', $value); } else { LogWrite("VolumeIncr: IGNORED MAX_VOLUME REACHED"); } $DataHandled = true; } elseif (strpos($message, "Volume Incr") !== false) { //Volume Incr if ($this->getState()->getState('Volume') < $this->getState()->getState('MAX_VOLUME')) { LogWrite("VolumeIncr: "); $value = $this->getState()->getState('Volume'); $value = $value + 1; if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeInc") == false) { $Continue = false; } $this->getState()->setState('Volume', $value); } else { LogWrite("VolumeIncr: IGNORED MAX_VOLUME REACHED"); } $DataHandled = true; } elseif (strpos($message, "Volume Decr5") !== false) { //Volume Decr5 LogWrite("VolumeDecr: "); $value = $this->getState()->getState('Volume'); $value = $value - 5; if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) { $Continue = false; } if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) { $Continue = false; } $this->getState()->setState('Volume', $value); $DataHandled = true; } elseif (strpos($message, "Volume Decr") !== false) { //Volume Decr LogWrite("VolumeDecr: "); $value = $this->getState()->getState('Volume'); $value = $value - 1; if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 VolumeDec") == false) { $Continue = false; } $this->getState()->setState('Volume', $value); $DataHandled = true; } elseif (strpos($message, "Volume Reset") !== false) { //Volume Reset LogWrite("VolumeReset: "); $value = 30; LogWrite("VolumeSet: " . $value); if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Volume 1 SetVolume \"" . $value . "\"") == false) { $Continue = false; } $this->getState()->setState('Volume', $value); $DataHandled = true; } } elseif (strpos($message, "Control") !== false) { // Here things happens - we execute the actions sent from the // application, by issuing a number of ACTIONs. if (strpos($message, "Control Play") !== false) { //Control Play if ($this->getState()->getState('TransportState') === "Stopped" || $this->getState()->getState('TransportState') === "Paused") { LogWrite("ControlPlay: "); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) { $Continue = false; } } $DataHandled = true; } elseif (strpos($message, "Control Pause") !== false) { //Control Pause if ($this->getState()->getState('TransportState') !== "Paused") { LogWrite("ControlPause: "); if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 Pause") == false) { $Continue = false; } } else { LogWrite("ControlPause - restart: "); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) { $Continue = false; } } $DataHandled = true; } elseif (strpos($message, "Control Stop") !== false) { //Control Stop if ($this->getState()->getState('TransportState') !== "Stopped") { LogWrite("ControlStop: "); if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Stop') == false) { $Continue = false; } } $DataHandled = true; } elseif (strpos($message, "Control Next") !== false) { //Control Next if ($this->getState()->getState('TransportState') != "Stopped") { LogWrite("ControlNext: "); if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 Next") == false) { $Continue = false; } } $DataHandled = true; } elseif (strpos($message, "Control Previous") !== false) { //Control Previous if ($this->getState()->getState('TransportState') != "Stopped") { LogWrite("ControlPrevious: "); if ($this->listeningSocket->getLPECListeningSocket()->Send("ACTION Ds/Playlist 1 Previous") == false) { $Continue = false; } } $DataHandled = true; } } elseif (strpos($message, "Source") !== false) { // Here things happens - we execute the actions sent from the // application, by issuing a number of ACTIONs. if (strpos($message, "Source Off") !== false) { //Source Off if ($this->getState()->getState('Standby') == "false") { if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetStandby "true"') == false) { $Continue = false; } $this->getState()->setState('Standby', true); } $DataHandled = true; } else { if ($this->getState()->getState('Standby') == "true") { if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetStandby "false"') == false) { $Continue = false; } $this->getState()->setState('Standby', true); } if (strpos($message, "Source Playlist") !== false) { //Source Playlist if ($this->getState()->getState('SourceIndex') != $this->getState()->getStateArray('SourceName', 'Playlist')) { if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetSourceIndex "' . $this->getState()->getStateArray('SourceName', 'Playlist') . '"') == false) { $Continue = false; } } if ($this->listeningSocket->getLPECListeningSocket()->CallClients('Play') == false) { $Continue = false; } $DataHandled = true; } elseif (strpos($message, "Source TV") !== false) { //Source TV if ($this->getState()->getState('SourceIndex') != $this->getState()->getStateArray('SourceName', 'TV')) { if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetSourceIndex "' . $this->getState()->getStateArray('SourceName', 'TV') . '"') == false) { $Continue = false; } } $DataHandled = true; } elseif (strpos($message, "Source Radio") !== false) { //Source Radio if ($this->getState()->getState('SourceIndex') != $this->getState()->getStateArray('SourceName', 'Radio')) { if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetSourceIndex "' . $this - getState()->getStateArray('SourceName', 'Radio') . '"') == false) { $Continue = false; } } $DataHandled = true; } elseif (strpos($message, "Source NetAux") !== false) { //Source NetAux if ($this->getState()->getState('SourceIndex') != $this->getState()->getStateArray('SourceName', 'Net Aux')) { if ($this->listeningSocket->getLPECListeningSocket()->Send('ACTION Ds/Product 1 SetSourceIndex "' . $this->getState()->getStateArray('SourceName', 'Net Aux') . '"') == false) { $Continue = false; } } $DataHandled = true; } } } elseif (strpos($message, "State") !== false) { LogWrite("HTState: " . $this->getState()->dump()); $seri = $this->getState()->Serialize(); LogWrite("Serialized: " . $seri); $this->Send($seri); $DataHandled = true; } return $DataHandled; }
<?php include "../ili-functions/functions.php"; function UserDeban($idUser) { $QueryUserDeban = "UPDATE users SET idRank='2' WHERE idUser='******' ;"; QueryExcute('', $QueryUserDeban); } Authorization('2'); AuthorizedPrivileges('USERS', 'U'); $idUser = $_GET['id']; $user = UserGetInfo($idUser); if ($user == '') { Redirect('index?message=14'); } else { UserDeban($idUser); $idUserSession = $_SESSION['user_id']; $UserUpdated = UserGetInfo($idUser); $UserUpdater = UserGetInfo($idUserSession); NotifAllWrite($idUser, '', '<a href="' . $URL . 'ili-users/user_profil?id=' . $idUser . '">' . $UserUpdater->FamilyName . ' ' . $UserUpdater->FirstName . ' a débanni ' . $UserUpdated->FamilyName . ' ' . $UserUpdated->FirstName); LogWrite("Utilisateur : " . $user->idUser . " a ete debanni"); Redirect('ili-users/user_edit?id=' . $idUser); }
} if (isset($_POST['Bank'])) { $Bank = addslashes($_POST['Bank']); } else { $Bank = ''; } if (isset($_POST['TransferDate'])) { $TransferDate = addslashes($_POST['TransferDate']); } else { $TransferDate = ''; } QueryExcute("", "INSERT INTO `payment` VALUES (NULL, '{$NowEN}', '{$Description}', '{$PaymentKind}', '{$PaymentCode}', '{$Bank}', '{$TransferDate}', '{$Amount}', '{$idUser}');"); $RecupIdPaiement = RecupIdPaiement(); $user = UserGetInfo($idUser); NotifAllWrite('', '', '<a href="' . $URL . 'ili-modules/caisse/paiement?id=' . $RecupIdPaiement . '">' . $user->FamilyName . ' ' . $user->FirstName . ', a effectuer un décaissement : ' . $Description . '</a>'); LogWrite("Décaissement : " . $Description); Redirect("ili-modules/caisse/journal"); } ?> </div> </div> </div> <!-- END PAGE CONTAINER--> </div> <!-- END PAGE --> </div> <!-- END CONTAINER --> <!-- BEGIN FOOTER --> <div id="footer"> <?php