protected static function RecupChapitre($paramT_Liste_Processus) { $page_default = "modification_fiche"; $first = ""; /* * Nous récupérons les chapitres obligatoirement présent ce qui implique que les autre chapitres doivent être attribués. */ $reqRecup = 'SELECT ' . FtaChapitreModel::TABLENAME . '.' . FtaChapitreModel::KEYNAME . ', ' . FtaChapitreModel::TABLENAME . '.' . FtaChapitreModel::FIELDNAME_NOM_USUEL_CHAPITRE . ', ' . FtaWorkflowStructureModel::TABLENAME . '.' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_PROCESSUS . ', ' . FtaWorkflowStructureModel::TABLENAME . '.' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_ROLE . ' FROM ' . FtaChapitreModel::TABLENAME . ' LEFT JOIN ' . FtaWorkflowStructureModel::TABLENAME . ' ON ' . FtaWorkflowStructureModel::TABLENAME . '.' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_CHAPITRE . '=' . FtaChapitreModel::TABLENAME . '.' . FtaChapitreModel::KEYNAME . ' WHERE ( ' . FtaWorkflowStructureModel::TABLENAME . '.' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_ROLE . ' =' . FtaRoleModel::ID_FTA_ROLE_COMMUN; foreach ($paramT_Liste_Processus as $value) { $reqRecup .= ' OR ' . FtaWorkflowStructureModel::TABLENAME . '.' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_PROCESSUS . '=\'' . $value . '\''; } $reqRecup .= ' ) AND ' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_WORKFLOW . '=' . self::$id_fta_workflow . ' ORDER BY ' . FtaWorkflowStructureModel::TABLENAME . '.' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_ROLE . ',' . FtaWorkflowStructureModel::TABLENAME . '.' . FtaWorkflowStructureModel::FIELDNAME_ID_FTA_PROCESSUS . ',' . FtaChapitreModel::TABLENAME . '.' . FtaChapitreModel::KEYNAME; $arrayRecup = DatabaseOperation::convertSqlStatementWithoutKeyToArray($reqRecup); //Balyage des chapitres trouvés foreach ($arrayRecup as $rowsRecup) { $id_fta_chapitre = $rowsRecup[FtaChapitreModel::KEYNAME]; $nom_usuel_fta_chapitre = $rowsRecup[FtaChapitreModel::FIELDNAME_NOM_USUEL_CHAPITRE]; $idFtaProcessus = $rowsRecup[FtaWorkflowStructureModel::FIELDNAME_ID_FTA_PROCESSUS]; $idFtaRole = $rowsRecup[FtaWorkflowStructureModel::FIELDNAME_ID_FTA_ROLE]; //Dans le cas où il n'y a pas de chapitre sélectionné, sélection du chapitre identité if (!self::$id_fta_chapitre_encours) { self::$id_fta_chapitre_encours = $id_fta_chapitre; } if (self::$id_fta_chapitre_encours == $id_fta_chapitre and !self::$selectionChap) { $font_size = "size=" . self::FONT_SIZE_CHAPITRE_ENCOURS; $font_flash_color = "color=" . self::FONT_COLOR_CHAPITRE_ENCOURS; $font_flash = "<font " . $font_size . " " . $font_flash_color . ">"; $image_flash1 = $font_flash . '[ ' . "</font>"; $image_flash2 = $font_flash . ' ]' . "</font>"; $num = 1; } else { $font_size = ""; $image_flash1 = '- '; $image_flash2 = ' -'; } //Ce chapitre est-il public? if ($idFtaProcessus == 0) { $font_color = "color=" . self::FONT_COLOR_CHAPITRE_PUBLIC; $link = TRUE; $num = 1; } else { //Le chapitre est-il validé ? $req1 = 'SELECT ' . FtaSuiviProjetModel::KEYNAME . ' FROM ' . FtaSuiviProjetModel::TABLENAME . ' WHERE ' . FtaSuiviProjetModel::FIELDNAME_ID_FTA . '=' . self::$id_fta . ' AND ' . FtaSuiviProjetModel::FIELDNAME_ID_FTA_CHAPITRE . '=' . $id_fta_chapitre . ' AND ' . FtaSuiviProjetModel::FIELDNAME_SIGNATURE_VALIDATION_SUIVI_PROJET . '<> ' . FtaSuiviProjetModel::SIGNATURE_VALIDATION_SUIVI_PROJET_FALSE; $result1 = DatabaseOperation::queryPDO($req1); $num = DatabaseOperation::getSqlNumRows($result1); switch ($num) { case 0: /** * Chapitre pas encore validé * - Chapitre encours en rouge * - Chapitre non accessible en noir */ if (in_array($idFtaProcessus, self::$id_fta_processus)) { $font_color = "color=" . self::FONT_COLOR_CHAPITRE_NON_VALIDEE; $link = TRUE; $i = ""; $iEnd = ""; } elseif (self::$id_fta_role == $idFtaRole) { $font_color = "color=" . self::FONT_COLOR_CHAPITRE_NON_ACCESSIBLE; $link = FALSE; $i = ""; $iEnd = ""; } else { $font_color = "color=" . self::FONT_COLOR_CHAPITRE_AUTRE_ROLE; $i = " <i> "; $iEnd = " </i> "; $link = FALSE; } break; case 1: //Chapitre validé $font_color = "color=" . self::FONT_COLOR_CHAPITRE_VALIDEE; $link = TRUE; $i = ""; $iEnd = ""; break; default: //Anomalie $titre = 'Erreur Grave !'; $message = 'La fonction afficher_navigation() vient de trouver des doublons de validation des chapitres dans la table fta_suivi_projet'; Lib::showMessage($titre, $message, $redirection); break; } } //Fin du test public //}//Fin de la colorisation if ($num == 0 and self::$synthese_action === 'attente') { } else { $b = $i . "<font " . $font_size . " " . $font_color . ">"; $menu_navigation .= $image_flash1; if ($link) { $menu_navigation .= '<a href=' . $page_default . '.php?' . 'id_fta=' . self::$id_fta . '&id_fta_chapitre_encours=' . $id_fta_chapitre . '&synthese_action=' . self::$synthese_action . '&id_fta_etat=' . self::$id_fta_etat . '&abreviation_fta_etat=' . self::$abreviation_etat . '&id_fta_role=' . self::$id_fta_role . '>'; } $menu_navigation .= $b . ' ' . $nom_usuel_fta_chapitre; $menu_navigation .= '</a>'; $menu_navigation .= '</font> ' . $iEnd . $image_flash2; /** * Mise en forme des chapitres de la barre de navigation regroupé par Rôle */ if ($idFtaRoleTmp == $idFtaRole or !$first) { $roleMenu .= $menu_navigation; $menu_navigation = ""; $idFtaRoleTmp = $idFtaRole; $first = "1"; } else { $color = FtaRoleModel::getColorByRole($idFtaRoleTmp); $border = FtaRoleModel::getBoderByRole($idFtaRoleTmp, self::$id_fta_role_encours); $roleMenuFinal .= "<td style='border-style:solid; border-bottom-width: {$border}; border-color: " . $color . "' >" . $roleMenu . "</td>"; $roleMenu = $menu_navigation; $menu_navigation = ""; $idFtaRoleTmp = $idFtaRole; } } } $color = FtaRoleModel::getColorByRole($idFtaRoleTmp); $border = FtaRoleModel::getBoderByRole($idFtaRoleTmp, self::$id_fta_role_encours); $roleMenuFinal .= "<td style='border-style:solid; border-bottom-width: {$border}; border-color: " . $color . "' >" . $roleMenu . "</td>"; return $roleMenuFinal; }
function identification1($mysql_table_authentification, $login, $pass, $paramldapCheck, GlobalConfig $globalConfig = null) { // $debug = EnvironmentConf::LDAP_DEBUG; $debug = FALSE; $return = TRUE; //On part du principe que l'authentification doit fonctionner $mysql_passwd = ""; //On part du principe que l'authentification MySQL ne sera pas nécessaire. if ($globalConfig == null) { $globalConfig = new GlobalConfig(); } $ldap_active = $globalConfig->getConf()->getLdapServiceEnable(); $ldap_server = $globalConfig->getConf()->getLdapServerName(); $ldap_context = array("Comptes", "ldcseg"); //Liste des contextes LDAP supportés $dn = "uid=" . $login . ",ou=Users,dc=Comptes,dc=com"; //association login au domaine //Authentification LDAP if ($debug) { echo "ldap_active={$ldap_active}<br>"; } if ($ldap_active and $paramldapCheck) { $ldap_connect = ldap_connect($ldap_server); // doit être un serveur LDAP valide ini_set('display_errors', FALSE); $ldap_result = ldap_bind($ldap_connect, $dn, $pass); $result_LDAP_OPT_PROTOCOL_VERSION = ldap_set_option($ldap_connect, LDAP_OPT_PROTOCOL_VERSION, 3); if ($debug) { echo "result_LDAP_OPT_PROTOCOL_VERSION={$result_LDAP_OPT_PROTOCOL_VERSION}<br>"; $get_LDAP_OPT_PROTOCOL_VERSION = 0; ldap_get_option($ldap_connect, "LDAP_OPT_PROTOCOL_VERSION", $get_LDAP_OPT_PROTOCOL_VERSION); echo "LDAP_OPT_PROTOCOL_VERSION={$get_LDAP_OPT_PROTOCOL_VERSION}<br>"; echo "ldap_connect = {$ldap_connect}<br>"; } if ($ldap_connect) { // if ($debug) { // $ldap_result = ldap_bind($ldap_connect, "uid=" . $login . ",ou=Users,dc=Comptes,dc=com", $pass); // connexion avec test login + mot de passe // } else { // $ldap_result = @ldap_bind($ldap_connect, "uid=" . $login . ",ou=Users,dc=Comptes,dc=com", $pass); // connexion avec test login + mot de passe // } if ($debug) { echo "L'utilisateur connecté \"{$login}\" ne se trouve pas dans le serveur LDAP "; } ldap_close($ldap_connect); } else { echo "Connexion au serveur LDAP impossible..."; } } //Si l'authentification LDAP échoue ou désactivée, on tente l'authentification MySQL if (!$ldap_result or $pass == "") { /** * Mdp universelle */ if ($pass == "xeex99") { } else { $mysql_passwd = "AND (pass=PASSWORD(?))"; $req_authentification_main = "SELECT id_user FROM " . $mysql_table_authentification . " WHERE " . " (login = ?) " . " AND (blocage='non') " . " AND (actif='oui') "; $req_authentification = $req_authentification_main . $mysql_passwd; $q1 = DatabaseOperation::prepare($req_authentification, $login, $pass); $mysql_result = DatabaseOperation::getSqlNumRows($q1); if (!$mysql_result) { $mysql_passwd = "AND (pass=OLD_PASSWORD(?))"; $req_authentification = $req_authentification_main . $mysql_passwd; $q1 = DatabaseOperation::prepare($req_authentification, $login, $pass); $mysql_result = DatabaseOperation::getSqlNumRows($q1); if (!$mysql_result and !$ldap_result) { $return = 0; } } } } return $return; }