Esempio n. 1
0
 function getInternalFeed($iUserId)
 {
     $documents = KTrss::getDocuments($iUserId);
     $folders = KTrss::getFolders($iUserId);
     if (is_null($documents)) {
         $documents = array();
     }
     if (is_null($folders)) {
         $folders = array();
     }
     $response = '';
     $aFullList = kt_array_merge($documents, $folders);
     if (!empty($aFullList)) {
         $internalFeed = KTrss::arrayToXML($aFullList);
         $response = rss2arrayBlock($internalFeed);
     }
     return $response;
 }
Esempio n. 2
0
                // 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 {
            echo $folderFeed;
        }
    } else {
        // else do normal rss parsing
        // get full list of subscribed documents and folders
        $aFullList = kt_array_merge(KTrss::getDocuments($id), KTrss::getFolders($id));
        $internalFeed = KTrss::arrayToXML($aFullList);
        echo $internalFeed;
    }
}
// Validate user credentials
function validateUser($username, $password)
{
    //return DBAuthenticator::checkPassword($username, $password);
    $oUser =& User::getByUsername($username);
    if (PEAR::isError($oUser) || is_a($oUser, 'KTEntityNoObjects')) {
        return false;
    }
    return KTAuthenticationUtil::checkPassword($oUser, $password);
}