Esempio n. 1
0
 /**
  * Créer la vue de la page
  */
 private function createView()
 {
     //Affichage des utilisateurs
     $this->oView->addData('titre', 'Administration des invitations');
     //Construction du tableau
     $oTable = new TableGenerator();
     $oTable->setId(md5('Administration des invitations'));
     $oTable->addColumn('Parrain');
     $oTable->addColumn('Code');
     $oTable->addColumn('Filleul');
     $oTable->addColumn('');
     $aInvites = Invites::getInvites();
     foreach ($aInvites as $oInvite) {
         //Affichage du type
         if ($oInvite->getFilleulId() === 0) {
             $sType = 'danger';
             $sText = 'Aucun';
             $oLabel = new View('label');
             $oLabel->addData('text', $sText);
             $oLabel->addData('type', $sType);
             $oLabel->create();
             $sFilleul = $oLabel->getCode();
         } else {
             $sFilleul = $oInvite->getFilleulLogin();
         }
         $oTable->addLine(array($oInvite->getParrainLogin(), $oInvite->getCode(), $sFilleul, $this->createEditPopup($oInvite)));
     }
     $oTable->setBottom($this->createAddPopup());
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->create();
 }
Esempio n. 2
0
 private function createView()
 {
     //Affichage des Trackers
     $this->oView->addData('titre', 'Signalements des membres');
     //Construction du tableau
     $oTable = new TableGenerator();
     $oTable->setId(md5('Signalements'));
     $oTable->addColumn('Date');
     $oTable->addColumn('Utilisateur');
     $oTable->addColumn('Fiche');
     $oTable->addColumn('Commentaire');
     $oTable->addColumn('');
     $aFiches = Fiche::getSignaledFiche();
     if ($aFiches != false) {
         foreach ($aFiches as $aFiche) {
             $oClearButton = new View('minibutton');
             $oClearButton->addData('link', 'index.php?p=modwarnings&type=' . $aFiche['type'] . '&id=' . $aFiche['id_fiche']);
             $oClearButton->addData('icon', 'fa-check');
             $oClearButton->addData('style', 'success');
             $oClearButton->create();
             $sLink = '<a href="index.php?p=fichedetail&type=' . $aFiche['type'] . '&id=' . $aFiche['id_fiche'] . '">[' . $aFiche['type'] . '] ' . $aFiche['id_fiche'] . '</a>';
             $oTable->addLine(array($aFiche['date'], $aFiche['login_user'], $sLink, $this->createCommentPopup($aFiche), $oClearButton->getCode()));
         }
     } else {
         $oTable->setBottom('Aucun signalement');
     }
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->create();
 }
Esempio n. 3
0
 public function procede()
 {
     if (!$this->oRequest->existParam('key')) {
         throw new Error('Vous devez renseigner la clé.', 3003);
     }
     if ($this->oRequest->getParam('key', 'string') != Config::get('ingestkey')) {
         throw new Error('La clé est invalide.', 3003);
     }
     //Ajoute du titre
     $this->oView->addData('titre', 'Analyse des releases');
     //On récupère les 30 dernières releases
     $oMysqli = Database::getInstance();
     //Traitement de la requête
     $sSqlRequest = "SELECT r.*, \r\n                        (SELECT GROUP_CONCAT(t.id_regex ORDER BY t.id_regex SEPARATOR ';') FROM tks_tags t WHERE t.id_release = r.id) AS tags,\r\n                        (SELECT GROUP_CONCAT(f.date ORDER BY f.date SEPARATOR ';') FROM tks_torrents f WHERE f.id_release = r.id) AS dates\t\r\n                        FROM tks_releases r \r\n                        WHERE r.id_categorie = '0' \r\n                        ORDER BY r.id DESC \r\n                        LIMIT 10";
     $oResults = $oMysqli->query($sSqlRequest);
     $oTable = new TableGenerator();
     $oTable->setId(md5('Scrapper'));
     $oTable->addColumn('Release');
     $oTable->addColumn('Catégorie');
     $oTable->addColumn('ID Fiche');
     $aCategories = Categorie::getCategoriesSelect();
     while ($aResult = $oResults->fetch_assoc()) {
         $oScrapper = new Scrapper($aResult['name'], $aResult['id']);
         $oScrapper->procede();
         $oTable->addLine(array($aResult['name'], $aCategories[$oScrapper->getCategorie()], $oScrapper->getFiche()));
     }
     $oTable->setBottom('');
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->Create();
 }
Esempio n. 4
0
 private function createView()
 {
     //Display keys
     $this->oView->addData('titre', Language::translate('API_ADMIN_TABLE_TITLE'));
     $oTable = new TableGenerator();
     $oTable->setId(md5('API'));
     $oTable->addColumn(Language::translate('API_ADMIN_TABLE_KEY'));
     $oTable->addColumn(Language::translate('API_ADMIN_TABLE_TYPE'));
     $oTable->addColumn('');
     $aKeys = ApiKey::getAllKeys();
     foreach ($aKeys as $oApiKey) {
         $oTable->addLine(array($oApiKey->getUserLogin(), $oApiKey->getKey(), $this->createAccessLabel($oApiKey), $this->createEditPopup($oApiKey)));
     }
     $oTable->setBottom($this->createAddPopup());
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->Create();
 }
Esempio n. 5
0
 public function procede()
 {
     if (!$this->oRequest->existParam('key')) {
         throw new Error('Vous devez renseigner la clé.', 3003);
     }
     if ($this->oRequest->getParam('key', 'string') != Config::get('ingestkey')) {
         throw new Error('La clé est invalide.', 3003);
     }
     //Ajoute du titre
     $this->oView->addData('titre', 'Analyse des flux RSS');
     //On récupère les éléments pour les statistiques
     $iNbReleases = Release::getCount();
     $iNbTorrents = Torrent::getCount();
     $iStartTime = time();
     //Traitement des Trackers
     $aTrackers = Tracker::getTrackers();
     //Ajout des flux
     $aRssList = Rss::getFlux();
     foreach ($aRssList as $oRss) {
         $aTrackers[$oRss->getTrackerId()]->addFlux($oRss);
     }
     //Parsage des flux
     $aResults = array();
     foreach ($aTrackers as $oTracker) {
         $aResults = array_merge($aResults, $oTracker->parseRss());
     }
     //Traitement des résultats
     $oTable = new TableGenerator();
     $oTable->setId(md5('Ingest'));
     $oTable->addColumn('Tags');
     $oTable->addColumn('Tracker');
     $oTable->addColumn('Release');
     foreach ($aResults as $oResult) {
         if (is_string($oResult)) {
             Logger::log('ingest', $oResult);
             $this->oView->addAlert($oResult, 'danger');
         } else {
             $oResult->store();
             $sTags = '';
             foreach ($oResult->getTags() as $oTag) {
                 $oTagView = new View('label');
                 $oTagView->addData('type', 'info');
                 $oTagView->addData('text', $oTag->getName());
                 $oTagView->create();
                 $sTags .= $oTagView->getCode() . '&nbsp;';
             }
             $oTable->addLine(array($sTags, $aTrackers[$oResult->getTracker()]->getName(), $oResult->getReleaseName()));
         }
     }
     //Statistiques
     $iNewReleases = Release::getCount() - $iNbReleases;
     $iNewTorrents = Torrent::getCount() - $iNbTorrents;
     Stats::storeIngestStats($iNewReleases, $iNewTorrents, date("Y-m-j G:i:s", $iStartTime));
     //Enregistrement de la dernière date de vérification
     Rss::updateLastCheck(date("Y-m-j G:i:s", $iStartTime));
     Logger::log('ingest', $iNewReleases . ' nouvelles releases et ' . $iNewTorrents . ' nouveaux torrents.');
     $oTable->setBottom($iNewReleases . ' nouvelles releases et ' . $iNewTorrents . ' nouveaux torrents.');
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->Create();
 }
Esempio n. 6
0
 private function createView()
 {
     $this->oView->addData('titre', Language::translate('RSS_ADMIN_TABLE_TITLE'));
     $oTable = new TableGenerator();
     $oTable->setId(md5('rss'));
     $oTable->addColumn(Language::translate('RSS_ADMIN_TABLE_TRACKER'));
     $oTable->addColumn(Language::translate('RSS_ADMIN_TABLE_URL'));
     $oTable->addColumn(Language::translate('RSS_ADMIN_TABLE_ENCODE'));
     $oTable->addColumn(Language::translate('RSS_ADMIN_TABLE_DATE'));
     $oTable->addColumn(Language::translate('RSS_ADMIN_TABLE_MASK'));
     $oTable->addColumn('');
     $aRss = Rss::getFlux();
     $aTrackers = Tracker::getTrackersSelect();
     $aCategories = Categorie::getCategoriesSelect();
     foreach ($aRss as $oRss) {
         $oTable->addLine(array($aTrackers[$oRss->getTrackerId()], $this->createUrlPopup($oRss), $oRss->getEncoding(), $oRss->isForcedate() ? Language::translate('RSS_ADMIN_TABLE_SERVER') : Language::translate('RSS_ADMIN_TABLE_RSS'), $this->createMaskPopup($oRss), $this->createEditPopup($oRss, $aTrackers, $aCategories)));
     }
     $oTable->setBottom($this->createAddPopup($aTrackers, $aCategories));
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->create();
 }
Esempio n. 7
0
 /**
  * Créer la vue pour la page
  */
 private function createView()
 {
     //Affichage des utilisateurs
     $this->oView->addData('titre', 'Administration des utilisateurs');
     //Construction du tableau
     $oTable = new TableGenerator();
     $oTable->setId(md5('Administration des utilisateurs'));
     $oTable->addColumn('Identifiant');
     $oTable->addColumn('Email');
     $oTable->addColumn('Rang');
     $oTable->addColumn('');
     $aUsers = User::getUsers();
     $aRanks = Rank::getRanksSelect();
     foreach ($aUsers as $oUser) {
         $oTable->addLine(array($oUser->getLogin(), $oUser->getMail(), $oUser->getRank()->getName(), $this->createEditPopup($oUser, $aRanks)));
     }
     $oTable->setBottom($this->createAddPopup($aRanks));
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     //Popup d'ajout
     $this->oView->Create();
 }
Esempio n. 8
0
 /**
  * Create View
  */
 private function createView()
 {
     $this->oView->addData('titre', Language::translate('PARSER_ADMIN_TABLE_TITLE'));
     $oTable = new TableGenerator();
     $oTable->setId(md5('Parser'));
     $oTable->addColumn(Language::translate('PARSER_ADMIN_TABLE_TAG'));
     $oTable->addColumn(Language::translate('PARSER_ADMIN_TABLE_REGEX'));
     $oTable->addColumn(Language::translate('PARSER_ADMIN_TABLE_CATEGORIE'));
     $oTable->addColumn('');
     $aRegex = Regex::getAllRegex();
     $aCategories = Categorie::getCategoriesSelect();
     $aCategories[0] = Language::translate('PARSER_ADMIN_TABLE_NONE');
     foreach ($aRegex as $oRegex) {
         $oTable->addLine(array($oRegex->getName(), $oRegex->getRegex(), $aCategories[$oRegex->getCategorie()], $this->createEditPopup($oRegex, $aCategories)));
     }
     $oTable->setBottom($this->createAddPopup($aCategories));
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->create();
 }
Esempio n. 9
0
 /**
  * Créer la page
  */
 private function createView()
 {
     //Affichage des passkeys
     $this->oView->addData('pk_titre', 'Mes passkeys');
     //Construction du tableau
     $oTable = new TableGenerator();
     $oTable->setId(md5('Mes passkeys'));
     $oTable->addColumn('Tracker');
     $oTable->addColumn('Passkey');
     $oTable->addColumn('');
     $aPasskeys = Passkey::getUserPasskeys($this->oCurrentUser->getId());
     $aTrackers = Tracker::getTrackersSelect();
     foreach ($aPasskeys as $oPasskey) {
         $oTable->addLine(array($oPasskey->getTrackerName(), $oPasskey->getPasskey(), $this->createPkEditPopup($oPasskey)));
     }
     $oTable->setBottom($this->createPkAddPopup($aTrackers));
     $oTable->create();
     $this->oView->addData('pk_content', $oTable->getCode());
     //Affichage RSS
     $oPurgeButton = new View('minibutton');
     $oPurgeButton->addData('link', 'index.php?p=profil&a=purge');
     $oPurgeButton->addData('icon', 'fa-trash-o');
     $oPurgeButton->addData('style', 'danger');
     $oPurgeButton->create();
     $this->oView->addData('rss_titre', 'Mes flux RSS');
     $this->oView->addData('rss_link', Config::get('installdir') . 'rss.php?cat=autoget&pk=' . $this->oCurrentUser->getPasskey());
     $this->oView->addData('rss_purge', $oPurgeButton->getCode());
     $aFlux = array();
     $aFlux[] = array("name" => "Général", "link" => Config::get('installdir') . 'rss.php?pk=' . $this->oCurrentUser->getPasskey());
     $aCategories = Categorie::getCategories();
     foreach ($aCategories as $oCategorie) {
         $aFlux[] = array("name" => $oCategorie->getName(), "link" => Config::get('installdir') . 'rss.php?cat=' . $oCategorie->getId() . '&pk=' . $this->oCurrentUser->getPasskey());
     }
     $this->oView->addData('rss_flux', $aFlux);
     $this->oView->addData('rss_passkey', $this->oCurrentUser->getPasskey());
     $this->oView->Create();
 }
Esempio n. 10
0
 /**
  * Create view
  */
 private function createView()
 {
     $this->oView->addData('titre', Language::translate('PERMISSIONS_ADMIN_TABLE_TITLE'));
     $oTable = new TableGenerator();
     $oTable->setId(md5('Access'));
     $aRanks = Rank::getRanks();
     $oTable->addColumn('');
     foreach ($aRanks as $oRank) {
         $oTable->addColumn($oRank->getName());
     }
     $aModules = Permission::getModules();
     foreach ($aModules as $iId => $sName) {
         $aBuffer = array();
         $aBuffer[] = $sName;
         foreach ($aRanks as $oRank) {
             if ($oRank->checkAccess($sName)) {
                 $sIcon = 'fa-check';
                 $sStyle = 'success';
                 $sNewValue = 'false';
             } else {
                 $sIcon = 'fa-times';
                 $sStyle = 'danger';
                 $sNewValue = 'true';
             }
             $oLabel = new View('minibutton');
             $oLabel->addData('icon', $sIcon);
             $oLabel->addData('style', $sStyle);
             $oLabel->addData('link', 'index.php?p=adminpermissions&m=' . $iId . '&r=' . $oRank->getId() . '&v=' . $sNewValue);
             $oLabel->create();
             $aBuffer[] = $oLabel->getCode();
         }
         $oTable->addLine($aBuffer);
     }
     $oTable->setBottom('');
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->Create();
 }
Esempio n. 11
0
 private function createView()
 {
     //Affichage des Trackers
     $this->oView->addData('titre', 'Administration des Trackers');
     //Construction du tableau
     $oTable = new TableGenerator();
     $oTable->setId(md5('Administration des Trackers'));
     $oTable->addColumn('Nom');
     $oTable->addColumn('Passkey');
     $oTable->addColumn('Lien de la fiche');
     $oTable->addColumn('Lien de téléchargement');
     $oTable->addColumn('');
     $aTrackers = Tracker::getTrackers();
     foreach ($aTrackers as $oTracker) {
         $oTable->addLine(array($oTracker->getName(), $oTracker->getNbPasskeys() == 0 ? 'Aucun' : $oTracker->getNbPasskeys() . ' passkeys', $this->createLinkPopup($oTracker), $this->createDirectLinkPopup($oTracker), $this->createEditPopup($oTracker)));
     }
     //Popup d'ajout
     $oTable->setBottom($this->createAddPopup() . '&nbsp;' . $this->createImportPopup());
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->create();
 }
Esempio n. 12
0
 private function createView()
 {
     $this->oView->addData('titre', Language::translate('RANKS_ADMIN_TABLE_TITLE'));
     $oTable = new TableGenerator();
     $oTable->setId(md5('ranks'));
     $oTable->addColumn(Language::translate('RANKS_ADMIN_TABLE_NAME'));
     $oTable->addColumn(Language::translate('RANKS_ADMIN_TABLE_DEFAULT'));
     $oTable->addColumn('');
     $aRanks = Rank::getRanks();
     foreach ($aRanks as $oRank) {
         if ($oRank->isDefault()) {
             $sType = 'success';
             $sText = Language::translate('RANKS_ADMIN_TABLE_YES');
         } else {
             $sType = 'danger';
             $sText = Language::translate('RANKS_ADMIN_TABLE_NO');
         }
         $oLabel = new View('label');
         $oLabel->addData('text', $sText);
         $oLabel->addData('type', $sType);
         $oLabel->create();
         $oTable->addLine(array($oRank->getName(), $oLabel->getCode(), $this->createEditPopup($oRank)));
     }
     $oTable->setBottom($this->createAddPopup());
     $oTable->create();
     $this->oView->addData('content', $oTable->getCode());
     $this->oView->Create();
 }