summaryrefslogtreecommitdiffstats
path: root/controller
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-02-15 21:08:27 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-02-15 21:08:27 +0100
commit9428c25c4682957ad21959eb6ff3137155785d50 (patch)
tree4f4588be88b76e00031e96d11becb2cea23300e8 /controller
parent0e240ee8a0393d50156a3078b76b52ad58fb2eb9 (diff)
spaces to tabs
Diffstat (limited to 'controller')
-rw-r--r--controller/news.controller.php154
1 files changed, 77 insertions, 77 deletions
diff --git a/controller/news.controller.php b/controller/news.controller.php
index 6194c0b28..9913f28a9 100644
--- a/controller/news.controller.php
+++ b/controller/news.controller.php
@@ -15,83 +15,83 @@ namespace OCA\News;
class NewsController extends Controller {
- private $feedMapper;
- private $folderMapper;
-
- /**
- * @param Request $request: the object with the request instance
- * @param string $api: an instance of the api wrapper object
- * @param FolderMapper $folderMapper: an instance of the folder mapper
- * @param FeedMapper $feedMapper: an instance of the feed mapper
- */
- public function __construct($request, $api, $feedMapper, $folderMapper){
- parent::__construct($request, $api);
- $this->feedMapper = $feedMapper;
- $this->folderMapper = $folderMapper;
- $this->api->activateNavigationEntry();
- }
-
-
- /**
- * OPML export download page
- */
- public function exportOPML($urlParams=array()){
- $opmlExporter = new OPMLExporter($this->api);
-
- $allFeeds = $this->folderMapper->childrenOfWithFeeds(0);
- $opml = $opmlExporter->buildOPML($allFeeds);
-
- $fileName = 'ownCloud ' . $this->trans->t('News') . ' ' . $this->userId . '.opml';
- $contentType = 'application/x.opml+xml';
- $response = new TextDownloadResponse($opml, $fileName, $contentType);
-
- return $response;
- }
-
-
- /**
- * Decides wether to show the feedpage or the firstrun page
- */
- public function index($urlParams=array()){
- $this->api->add3rdPartyScript('angular/angular');
- $this->api->add3rdPartyScript('angular-ui/angular-ui');
- $this->api->add3rdPartyScript('moment.min');
- $this->api->addScript('app');
- $this->api->addScript('multiselect', 'core');
-
- $this->api->addStyle('owncloud');
- $this->api->addStyle('addnew');
- $this->api->addStyle('feeds');
- $this->api->addStyle('items');
- $this->api->addStyle('settings');
- $this->api->addStyle('addnew');
- $this->api->addStyle('showall');
-
- if($urlParams['feedid']){
- $this->api->setUserValue('lastViewedFeed', $urlParams['feedid']);
- $this->api->setUserValue('lastViewedFeedType', FeedType::FEED);
- }
-
- $lastViewedFeedId = $this->api->getUserValue('lastViewedFeed');
- $lastViewedFeedType = $this->api->getUserValue('lastViewedFeedType');
-
- if( $lastViewedFeedId === null || $lastViewedFeedType === null) {
- $this->api->setUserValue('lastViewedFeed', $this->feedMapper->mostRecent());;
- $this->api->setUserValue('lastViewedFeedType', FeedType::FEED);
-
- } else {
- // check if the last selected feed or folder exists
- if(($lastViewedFeedType === FeedType::FEED &&
- $this->feedMapper->findById($lastViewedFeedId) === null) ||
- ($lastViewedFeedType === FeedType::FOLDER &&
- $this->folderMapper->findById($lastViewedFeedId) === null)){
- $this->api->setUserValue('lastViewedFeed', $this->feedMapper->mostRecent());;
- $this->api->setUserValue('lastViewedFeedType', FeedType::FEED);
- }
- }
-
- return $this->render('main');
- }
+ private $feedMapper;
+ private $folderMapper;
+
+ /**
+ * @param Request $request: the object with the request instance
+ * @param string $api: an instance of the api wrapper object
+ * @param FolderMapper $folderMapper: an instance of the folder mapper
+ * @param FeedMapper $feedMapper: an instance of the feed mapper
+ */
+ public function __construct($request, $api, $feedMapper, $folderMapper){
+ parent::__construct($request, $api);
+ $this->feedMapper = $feedMapper;
+ $this->folderMapper = $folderMapper;
+ $this->api->activateNavigationEntry();
+ }
+
+
+ /**
+ * OPML export download page
+ */
+ public function exportOPML($urlParams=array()){
+ $opmlExporter = new OPMLExporter($this->api);
+
+ $allFeeds = $this->folderMapper->childrenOfWithFeeds(0);
+ $opml = $opmlExporter->buildOPML($allFeeds);
+
+ $fileName = 'ownCloud ' . $this->trans->t('News') . ' ' . $this->userId . '.opml';
+ $contentType = 'application/x.opml+xml';
+ $response = new TextDownloadResponse($opml, $fileName, $contentType);
+
+ return $response;
+ }
+
+
+ /**
+ * Decides wether to show the feedpage or the firstrun page
+ */
+ public function index($urlParams=array()){
+ $this->api->add3rdPartyScript('angular/angular');
+ $this->api->add3rdPartyScript('angular-ui/angular-ui');
+ $this->api->add3rdPartyScript('moment.min');
+ $this->api->addScript('app');
+ $this->api->addScript('multiselect', 'core');
+
+ $this->api->addStyle('owncloud');
+ $this->api->addStyle('addnew');
+ $this->api->addStyle('feeds');
+ $this->api->addStyle('items');
+ $this->api->addStyle('settings');
+ $this->api->addStyle('addnew');
+ $this->api->addStyle('showall');
+
+ if($urlParams['feedid']){
+ $this->api->setUserValue('lastViewedFeed', $urlParams['feedid']);
+ $this->api->setUserValue('lastViewedFeedType', FeedType::FEED);
+ }
+
+ $lastViewedFeedId = $this->api->getUserValue('lastViewedFeed');
+ $lastViewedFeedType = $this->api->getUserValue('lastViewedFeedType');
+
+ if( $lastViewedFeedId === null || $lastViewedFeedType === null) {
+ $this->api->setUserValue('lastViewedFeed', $this->feedMapper->mostRecent());;
+ $this->api->setUserValue('lastViewedFeedType', FeedType::FEED);
+
+ } else {
+ // check if the last selected feed or folder exists
+ if(($lastViewedFeedType === FeedType::FEED &&
+ $this->feedMapper->findById($lastViewedFeedId) === null) ||
+ ($lastViewedFeedType === FeedType::FOLDER &&
+ $this->folderMapper->findById($lastViewedFeedId) === null)){
+ $this->api->setUserValue('lastViewedFeed', $this->feedMapper->mostRecent());;
+ $this->api->setUserValue('lastViewedFeedType', FeedType::FEED);
+ }
+ }
+
+ return $this->render('main');
+ }
}
"w"> int reenter = 1; #endif /* deny if no user. */ if (pw == NULL) return 0; #ifndef HAVE_CYGWIN if (pw->pw_uid == 0 && options.permit_root_login == 2) return 0; #endif #ifdef HAVE_CYGWIN /* * Empty password is only possible on NT if the user has _really_ * an empty password and authentication is done, though. */ if (!is_winnt) #endif if (*password == '\0' && options.permit_empty_passwd == 0) return 0; #ifdef HAVE_CYGWIN if (is_winnt) { HANDLE hToken = cygwin_logon_user(pw, password); if (hToken == INVALID_HANDLE_VALUE) return 0; cygwin_set_impersonation_token(hToken); return 1; } #endif #ifdef SKEY if (options.skey_authentication == 1) { int ret = auth_skey_password(pw, password); if (ret == 1 || ret == 0) return ret; /* Fall back to ordinary passwd authentication. */ } #endif #ifdef WITH_AIXAUTHENTICATE return (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0); #endif #ifdef KRB4 if (options.kerberos_authentication == 1) { int ret = auth_krb4_password(pw, password); if (ret == 1 || ret == 0) return ret; /* Fall back to ordinary passwd authentication. */ } #endif /* Check for users with no password. */ if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0) return 1; pw_password = pw->pw_passwd; #if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) spw = getspnam(pw->pw_name); if (spw != NULL) { /* Check for users with no password. */ if (strcmp(password, "") == 0 && strcmp(spw->sp_pwdp, "") == 0) return 1; pw_password = spw->sp_pwdp; } #endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */ #if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL) { /* Check for users with no password. */ if (strcmp(password, "") == 0 && strcmp(spw->pwa_passwd, "") == 0) return 1; pw_password = spw->pwa_passwd; } #endif /* defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) */ if (pw_password[0] != '\0') salt = pw_password; else salt = "xx"; #ifdef HAVE_MD5_PASSWORDS if (is_md5_salt(salt)) encrypted_password = md5_crypt(password, salt); else encrypted_password = crypt(password, salt); #else /* HAVE_MD5_PASSWORDS */ # ifdef HAVE_HPUX_TRUSTED_SYSTEM_PW encrypted_password = bigcrypt(password, salt); # else encrypted_password = crypt(password, salt); # endif /* HAVE_HPUX_TRUSTED_SYSTEM_PW */ #endif /* HAVE_MD5_PASSWORDS */ /* Authentication is accepted if the encrypted passwords are identical. */ return (strcmp(encrypted_password, pw_password) == 0); } #endif /* !USE_PAM && !HAVE_OSF_SIA */