Exemple #1
0
         $error = KTrss::errorToXML(_kt('You are either not authorised to view details on this document or it does not exist.' . ' Please visit http://' . $_SERVER['HTTP_HOST'] . '/' . $GLOBALS['KTRootUrl'] . '/ to browse for a valid document.'));
     }
     if (isset($error)) {
         // if an error exist, output...else out the result
         echo $error;
     } else {
         echo $documentFeed;
     }
 } elseif (KTUtil::arrayGet($_REQUEST, 'folderId')) {
     // if a folderId parameter is passed
     // get folder id from http request object
     $iFolderId = KTUtil::arrayGet($_REQUEST, 'folderId');
     if (KTrss::validateFolderPermissions($id, $iFolderId)) {
         // if folder passes validation check
         // get folder info
         $aFolderInfo[] = KTrss::getOneFolder($iFolderId);
         if ($aFolderInfo) {
             // create rss xml for folder
             $folderFeed = KTrss::arrayToXML($aFolderInfo);
         } else {
             // create rss xml for error
             $error = KTrss::errorToXML(_kt('This document has returned a empty response'));
         }
     } else {
         // create rss xml for error
         $error = KTrss::errorToXML(_kt('You are either not authorised to view details on this folder or it does not exist.' . ' Please visit http://' . $_SERVER['HTTP_HOST'] . '/' . $GLOBALS['KTRootUrl'] . '/ to browse for a valid folder.'));
     }
     if (isset($error)) {
         // if an error exist, output...else out the result
         echo $error;
     } else {
Exemple #2
0
 function getFolders($iUserId)
 {
     $aFList = KTrss::getFolderList($iUserId);
     if ($aFList) {
         foreach ($aFList as $folder_id) {
             $folder = KTrss::getOneFolder($folder_id);
             if ($folder) {
                 $aFolders[] = $folder;
             }
         }
     }
     if (PEAR::isError($aFolders)) {
         // XXX: log error
         return false;
     }
     if ($aFolders) {
         return $aFolders;
     }
 }