本文整理汇总了PHP中isAuth函数的典型用法代码示例。如果您正苦于以下问题:PHP isAuth函数的具体用法?PHP isAuth怎么用?PHP isAuth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isAuth函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: envoi
public function envoi()
{
if (!isAuth(307)) {
return;
}
$this->view->clientsJS("message" . DS . "envoi");
$view = new View();
if (!empty($this->request->message)) {
# Envoyer le SMS et rediriger vers la page de suivi de SMS
$this->activateSMS();
$retval = $this->send($this->request->destinataire, $this->request->message);
if ($retval === false) {
$view->Assign("errors", true);
} else {
$view->Assign("errors", false);
# Inserer dans la table message envoyes
$personnel = $this->Personnel->getBy(["USER" => $this->session->iduser]);
$params = ["dateenvoie" => date("Y-m-d H:i:s", time()), "destinataire" => $this->request->destinataire, "expediteur" => $personnel['IDPERSONNEL'], "message" => $this->request->message];
$this->Messageenvoye->insert($params);
}
}
$destinataires = $this->Repertoire->getDestinataires();
$view->Assign("destinataires", $destinataires);
$content = $view->Render("message" . DS . "envoi", false);
$this->Assign("content", $content);
}
示例2: saisie
/**
* Droit saisie punition: 315
*/
public function saisie()
{
if (!isAuth(315)) {
return;
}
if (!empty($this->request->punipar)) {
$params = ["eleve" => $this->request->comboEleves, "datepunition" => $this->request->datepunition, "dateenregistrement" => date("Y-m-d", time()), "duree" => $this->request->duree, "typepunition" => $this->request->comboTypes, "motif" => $this->request->motif, "description" => $this->request->description, "punipar" => $this->request->punipar, "enregistrerpar" => $this->session->user, "anneeacademique" => $this->session->anneeacademique];
$this->Punition->insert($params);
header("Location:" . Router::url("punition"));
}
$this->view->clientsJS("punition" . DS . "punition");
$view = new View();
$type = $this->Typepunition->selectAll();
$comboTypes = new Combobox($type, "comboTypes", $this->Typepunition->getKey(), $this->Typepunition->getLibelle());
$comboTypes->first = " ";
$view->Assign("comboTypes", $comboTypes->view());
$view->Assign("comboClasses", $this->comboClasses->view());
$personnels = $this->Personnel->selectAll();
$comboPersonnels = new Combobox($personnels, "comboPersonnels", $this->Personnel->getKey(), $this->Personnel->getLibelle());
$comboPersonnels->first = " ";
$view->Assign("comboPersonnels", $comboPersonnels->view());
$content = $view->Render("punition" . DS . "saisie", false);
$this->Assign("content", $content);
//$this->Assign("content", (new View())->output());
}
示例3: saisie
public function saisie()
{
if (!isAuth(501)) {
return;
}
$view = new View();
$view->Assign("errors", false);
$message = "";
$logo = "";
if (!empty($this->request->identifiant) && !empty($this->request->nom) && !empty($this->request->adresse)) {
//validation du logo
if (isset($this->request->logo) && !empty($this->request->logo['tmp_name'])) {
if (move_uploaded_file($this->request->logo['tmp_name'], ROOT . "/photos/" . $this->request->logo['name'])) {
$logo = SITE_ROOT . "photos/" . $this->request->logo['name'];
} else {
$message = "Erreur lors de la sauvegarde du logo : " . $this->request->logo['name'];
return false;
}
}
$params = ["identifiant" => $this->request->identifiant, "nom" => $this->request->nom, "adresse" => $this->request->adresse, "bp" => $this->request->bp, "tel1" => $this->request->tel1, "tel2" => $this->request->tel2, "mobile" => $this->request->mobile, "fax" => $this->request->fax, "email" => $this->request->email, "siteweb" => $this->request->siteweb, "responsable" => $this->request->responsable, "logo" => $logo];
//Insertion dans la BD
$this->loadModel("locan");
if ($this->Locan->insert($params)) {
header("Location: " . Router::url("etablissement"));
} else {
$message = "Erreur lors de l'insertion";
}
}
//Affichage du formulaire
if (!empty($message)) {
$view->Assign("errors", true);
}
$content = $view->Render("etablissement" . DS . "saisie", false);
$this->Assign("content", $content);
}
示例4: envoi
public function envoi()
{
if (!isAuth(307)) {
return;
}
if (!empty($this->request->message)) {
$retval = $this->envoiIndividuel();
} elseif (!empty($this->request->messageparclasse)) {
$retval = $this->envoiParclasse();
} elseif (!empty($this->request->messagecollectif)) {
$retval = $this->envoiCollectif();
}
$this->view->clientsJS("message" . DS . "envoi");
$view = new View();
if (isset($retval)) {
$view->Assign("errors", !$retval);
}
$destinataires = $this->Repertoire->getDestinataires();
$view->Assign("destinataires", $destinataires);
$parclasse = $this->Classe->selectAll();
$comboParclasse = new Combobox($parclasse, "parclasse", "IDCLASSE", "NIVEAUSELECT");
$comboParclasse->first = " ";
$view->Assign("comboParclasse", $comboParclasse->view());
$content = $view->Render("message" . DS . "envoi", false);
$this->Assign("content", $content);
}
示例5: isAdmin
/**
* Comproba si el usuari que fa la petició te
* rol `admin`
*
* @param obj $req
* @param obj $res
* @return boolean
*/
function isAdmin($req, $res)
{
$next = false;
if (isAuth() && $req->session['user']['role'] === "admin") {
$next = true;
}
return $next;
}
示例6: selectAll
public function selectAll()
{
if (isAuth(531)) {
$query = "SELECT * FROM matieres ORDER BY LIBELLE";
return $this->query($query);
} else {
$query = "SELECT DISTINCT(m.IDMATIERE), m.* " . "FROM `" . $this->_table . "` m " . "INNER JOIN enseignements ens ON ens.MATIERE = m.IDMATIERE " . "INNER JOIN personnels p ON p.IDPERSONNEL = ens.PROFESSEUR AND p.USER = :restriction " . "ORDER BY LIBELLE";
return $this->query($query, ["restriction" => $_SESSION['iduser']]);
}
}
示例7: getNotationsByMatieresByPeriode
/**
* Obtient les information concernant des notation
* en se basant sur la matieres enseignees, utilise pour la methode note/statistique par matiere
*
*/
public function getNotationsByMatieresByPeriode($idmatiere, $periode)
{
if (isAuth(531)) {
$query = "SELECT n.*, " . "(SELECT MAX(NOTE) FROM notes WHERE n.IDNOTATION = notes.NOTATION) AS NOTEMAX, " . "(SELECT MIN(NOTE) FROM notes WHERE n.IDNOTATION = notes.NOTATION) AS NOTEMIN, " . "(SELECT AVG(NOTE) FROM notes WHERE n.IDNOTATION = notes.NOTATION) AS NOTEMOYENNE, " . "c.*, c.LIBELLE AS CLASSELIBELLE, ni.*, " . "s.LIBELLE AS SEQUENCELIBELLE, p.* " . "FROM notations n " . "INNER JOIN sequences s ON s.IDSEQUENCE = n.SEQUENCE AND n.SEQUENCE = :sequence " . "INNER JOIN enseignements e ON e.IDENSEIGNEMENT = n.ENSEIGNEMENT AND e.MATIERE = :idmatiere " . "LEFT JOIN personnels p ON p.IDPERSONNEL = e.PROFESSEUR " . "INNER JOIN classes c ON c.IDCLASSE = e.CLASSE " . "INNER JOIN niveau ni ON ni.IDNIVEAU = c.NIVEAU ";
return $this->query($query, ['idmatiere' => $idmatiere, "sequence" => $periode]);
} else {
$query = "SELECT n.*, " . "(SELECT MAX(NOTE) FROM notes WHERE n.IDNOTATION = notes.NOTATION) AS NOTEMAX, " . "(SELECT MIN(NOTE) FROM notes WHERE n.IDNOTATION = notes.NOTATION) AS NOTEMIN, " . "(SELECT AVG(NOTE) FROM notes WHERE n.IDNOTATION = notes.NOTATION) AS NOTEMOYENNE, " . "c.*, c.LIBELLE AS CLASSELIBELLE, ni.*, " . "s.LIBELLE AS SEQUENCELIBELLE, p.*, cy.DESCRIPTIONHTML AS CYCLEHTML " . "FROM notations n " . "INNER JOIN sequences s ON s.IDSEQUENCE = n.SEQUENCE AND n.SEQUENCE = :sequence " . "INNER JOIN enseignements e ON e.IDENSEIGNEMENT = n.ENSEIGNEMENT AND e.MATIERE = :idmatiere " . "INNER JOIN personnels p ON p.IDPERSONNEL = e.PROFESSEUR AND p.USER = :restriction " . "INNER JOIN classes c ON c.IDCLASSE = e.CLASSE " . "INNER JOIN cycles cy ON cy.IDCYCLE = c.CYCLE " . "INNER JOIN niveau ni ON ni.IDNIVEAU = c.NIVEAU " . "ORDER BY cy.IDCYCLE ASC, ni.GROUPE DESC, ni.NIVEAUHTML ASC";
return $this->query($query, ['idmatiere' => $idmatiere, "sequence" => $periode, "restriction" => $_SESSION['iduser']]);
}
}
示例8: getNotesEleveByClasse
/**
* Obtenir tous les notes de cette eleves pour cette classe
* Utiliser dans eleve/index, onglet 5 pour afficher les notes qu'il a eu pendant une
* annee academique
* @param type $ideleve
* @param type $idclasse
*/
public function getNotesEleveByClasse($ideleve, $idclasse)
{
if (isAuth(531)) {
$query = "SELECT n.*, el.*, nota.*, c.*, seq.*, mat.*, mat.LIBELLE AS MATIERELIBELLE " . "FROM notes n " . "INNER JOIN eleves el ON el.IDELEVE = n.ELEVE " . "INNER JOIN notations nota ON nota.IDNOTATION = n.NOTATION " . "INNER JOIN sequences seq ON seq.IDSEQUENCE = nota.SEQUENCE " . "INNER JOIN enseignements ens ON ens.IDENSEIGNEMENT = nota.ENSEIGNEMENT AND ens.CLASSE = :idclasse " . "INNER JOIN classes c ON c.IDCLASSE = ens.CLASSE " . "INNER JOIN matieres mat ON mat.IDMATIERE = ens.MATIERE " . "WHERE n.ELEVE = :ideleve";
return $this->query($query, ["idclasse" => $idclasse, "ideleve" => $ideleve]);
} else {
$query = "SELECT n.*, el.*, nota.*, c.*, seq.*, mat.*, mat.LIBELLE AS MATIERELIBELLE " . "FROM notes n " . "INNER JOIN eleves el ON el.IDELEVE = n.ELEVE " . "INNER JOIN notations nota ON nota.IDNOTATION = n.NOTATION " . "INNER JOIN sequences seq ON seq.IDSEQUENCE = nota.SEQUENCE " . "INNER JOIN enseignements ens ON ens.IDENSEIGNEMENT = nota.ENSEIGNEMENT AND ens.CLASSE = :idclasse " . "INNER JOIN personnels p ON p.IDPERSONNEL = ens.PROFESSEUR AND p.USER = :restriction " . "INNER JOIN classes c ON c.IDCLASSE = ens.CLASSE " . "INNER JOIN matieres mat ON mat.IDMATIERE = ens.MATIERE " . "WHERE n.ELEVE = :ideleve";
return $this->query($query, ["idclasse" => $idclasse, "ideleve" => $ideleve, "restriction" => $_SESSION['iduser']]);
}
}
示例9: __construct
public function __construct(Request $request)
{
AppOptionHelper::load();
$this->localeCode = currentLocaleCode();
$this->is_auth = isAuth();
$this->auth_user = authUser();
if ($this->is_auth) {
$own_directory = $this->auth_user->ownDirectory;
config(['katniss.disks.' . $own_directory => ['driver' => 'local', 'root' => storage_path('../public/upload/file_manager/users/' . $own_directory)]]);
}
}
示例10: getAllEnseignements
/**
* Renvoie tous les enseignement qui passe dans cette annee academique
* @param type $anneeacad
*/
public function getAllEnseignements($anneeacad)
{
if (isAuth(531)) {
$query = "SELECT e.*, m.LIBELLE AS MATIERELIBELLE, m.*," . " p.*, c.*, c.LIBELLE AS CLASSELIBELLE, g.DESCRIPTION, n.* " . "FROM enseignements e " . "INNER JOIN matieres m ON m.IDMATIERE = e.MATIERE " . "LEFT JOIN personnels p ON p.IDPERSONNEL = e.PROFESSEUR " . "INNER JOIN classes c ON c.IDCLASSE = e.CLASSE AND c.ANNEEACADEMIQUE = :anneeacad \n\t\t\t\tINNER JOIN niveau n ON n.IDNIVEAU = c.NIVEAU " . "LEFT JOIN groupe g ON g.IDGROUPE = e.GROUPE " . "ORDER BY e.IDENSEIGNEMENT";
$params = ["anneeacad" => $anneeacad];
return $this->query($query, $params);
} else {
$query = "SELECT e.*, m.LIBELLE AS MATIERELIBELLE, m.*," . " p.*, c.*, c.LIBELLE AS CLASSELIBELLE, g.DESCRIPTION, n.* " . "FROM enseignements e " . "INNER JOIN matieres m ON m.IDMATIERE = e.MATIERE " . "INNER JOIN personnels p ON p.IDPERSONNEL = e.PROFESSEUR AND p.USER = :restriction " . "INNER JOIN classes c ON c.IDCLASSE = e.CLASSE AND c.ANNEEACADEMIQUE = :anneeacad \n\t\t\t\tINNER JOIN niveau n ON n.IDNIVEAU = c.NIVEAU " . "LEFT JOIN groupe g ON g.IDGROUPE = e.GROUPE " . "ORDER BY e.IDENSEIGNEMENT";
$params = ["anneeacad" => $anneeacad, "restriction" => $_SESSION['iduser']];
return $this->query($query, $params);
}
}
示例11: payement
function payement()
{
if (!isAuth(508)) {
return;
}
$this->view->clientsJS("scolarite" . DS . "payement");
$view = new View();
$this->comboClasses->first = " ";
$view->Assign("comboClasses", $this->comboClasses->view());
$content = $view->Render("scolarite" . DS . "payement", false);
$this->Assign("content", $content);
}
示例12: saisie
public function saisie()
{
if (!isAuth(523)) {
return;
}
$this->view->clientsJS("activite" . DS . "saisie");
$view = new View();
$this->comboClasses->first = " ";
$view->Assign("comboClasses", $this->comboClasses->view());
$content = $view->Render("activite" . DS . "saisie", false);
$this->Assign("content", $content);
}
示例13: selectAll
public function selectAll()
{
/* $query = "SELECT c.*, d.LIBELLE AS FK_DECOUPAGE FROM classes c "
. "LEFT JOIN decoupage d ON c.DECOUPAGE = d.IDDECOUPAGE"; */
if (isAuth(531)) {
$query = "SELECT c.* , d.LIBELLE AS FK_DECOUPAGE, n.* " . "FROM classes c " . "LEFT JOIN decoupage d ON c.DECOUPAGE = d.IDDECOUPAGE " . "LEFT JOIN niveau n ON n.IDNIVEAU = c.NIVEAU " . "WHERE c.ANNEEACADEMIQUE = :anneeacad " . "ORDER BY n.GROUPE DESC";
return $this->query($query, ['anneeacad' => $_SESSION['anneeacademique']]);
} else {
$query = "SELECT DISTINCT(c.IDCLASSE), c.* , d.LIBELLE AS FK_DECOUPAGE, n.* " . "FROM classes c " . "INNER JOIN enseignements ens ON ens.CLASSE = c.IDCLASSE " . "INNER JOIN personnels p ON p.IDPERSONNEL = ens.PROFESSEUR AND p.USER = :restriction " . "LEFT JOIN decoupage d ON c.DECOUPAGE = d.IDDECOUPAGE " . "LEFT JOIN niveau n ON n.IDNIVEAU = c.NIVEAU " . "WHERE c.ANNEEACADEMIQUE = :anneeacad " . "ORDER BY n.GROUPE DESC";
$params = ["restriction" => $_SESSION['iduser'], 'anneeacad' => $_SESSION['anneeacademique']];
return $this->query($query, $params);
}
}
示例14: index
public function index()
{
if (!isAuth(207)) {
return;
}
$this->view->clientsJS("enseignant" . DS . "index");
$view = new View();
$enseignants = $this->Personnel->findBy(["FONCTION" => 1]);
$comboEnseignants = new Combobox($enseignants, "comboEnseignants", $this->Personnel->getKey(), ["NOM", "PRENOM"]);
$comboEnseignants->first = " ";
$view->Assign("comboEnseignants", $comboEnseignants->view());
$content = $view->Render("enseignant" . DS . "index", false);
$this->Assign("content", $content);
}
示例15: saisie
function saisie()
{
if (!isAuth(509)) {
return;
}
$this->view->clientsJS("frais" . DS . "frais");
$view = new View();
$data = $this->Classe->findBy(["ANNEEACADEMIQUE" => $this->session->anneeacademique]);
$comboClasses = new Combobox($data, "comboClasses", "IDCLASSE", "LIBELLE");
$comboClasses->first = " ";
$view->Assign("comboClasses", $comboClasses->view());
$content = $view->Render("frais" . DS . "saisie", false);
$this->Assign("content", $content);
}