]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
privatekey -> privateKey everywhere
authorChristian Weiske <cweiske@cweiske.de>
Mon, 27 Jun 2011 20:31:24 +0000 (22:31 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 27 Jun 2011 20:31:24 +0000 (22:31 +0200)
src/SemanticScuttle/Service/User.php
tests/TestBase.php
tests/UserTest.php
tests/www/bookmarksTest.php
tests/www/indexTest.php
tests/www/rssTest.php
www/bookmarks.php
www/index.php
www/rss.php
www/tags.php

index b5b053fdb9a01f1edfa388ae68ef9aba7e537030..7550ed22404c4c3636af1766966719ba2034a2e6 100644 (file)
@@ -51,7 +51,7 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService
         'primary'    => 'uId',
         'username'   => 'username',
         'password'   => 'password',
-        'privatekey' => 'privatekey'
+        'privateKey' => 'privateKey'
     );
 
     protected $profileurl;
@@ -219,13 +219,13 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService
     /**
      * Returns user row from database.
      *
-     * @param string $privatekey Private Key
+     * @param string $privateKey Private Key
      *
      * @return array User array from database, false if no user was found
      */
-    public function getUserByPrivateKey($privatekey)
+    public function getUserByPrivateKey($privateKey)
     {
-        return $this->_getuser($this->getFieldName('privatekey'), $privatekey);
+        return $this->_getuser($this->getFieldName('privateKey'), $privateKey);
     }
 
     function getObjectUserByUsername($username) {
@@ -539,24 +539,24 @@ class SemanticScuttle_Service_User extends SemanticScuttle_DbService
     }
 
     /**
-     * Try to authenticate via the privatekey
+     * Try to authenticate via the privateKey
      *
-     * @param string $privatekey Private Key
+     * @param string $privateKey Private Key
      *
      * @return boolean true if the user could be authenticated,
      *                 false if not.
      */
-    public function loginPrivateKey($privatekey)
+    public function loginPrivateKey($privateKey)
     {
         /* Check if private key valid and enabled */
-        if (!$this->isPrivateKeyValid($privatekey)) {
+        if (!$this->isPrivateKeyValid($privateKey)) {
             return false;
         }
 
         $query = 'SELECT '. $this->getFieldName('primary') .' FROM '
             . $this->getTableName() .' WHERE '
-            . $this->getFieldName('privatekey') .' = "'
-            . $this->db->sql_escape($privatekey) .'"';
+            . $this->getFieldName('privateKey') .' = "'
+            . $this->db->sql_escape($privateKey) .'"';
 
         if (!($dbresult = $this->db->sql_query($query))) {
             message_die(
index 2180d2d24129621bbbbcd0857fc2e38e38f2bc07..2914749a6357a38c24750e2694b69651ba378f6f 100644 (file)
@@ -99,7 +99,7 @@ class TestBase extends PHPUnit_Framework_TestCase
      * @param string $password   Password, may be null
      * @param mixed  $privateKey String private key or boolean true to generate one
      *
-     * @return array ID of user, Name of user, password of user, privatekey
+     * @return array ID of user, Name of user, password of user, privateKey
      */
     protected function addUserData(
         $username = null, $password = null, $privateKey = null
index 230167d7e8731f13fef80e539e840aee53b1cb3c..6cd67866189b5e96e4176c197433668b9ce61cef 100644 (file)
@@ -40,7 +40,7 @@ class UserTest extends TestBase
     public function testAddUserPrivateKey()
     {
         $name = substr(md5(uniqid()), 0, 6);
-        $pkey = 'my-privatekey';
+        $pkey = 'my-privateKey';
         $id   = $this->us->addUser(
             $name, uniqid(), 'foo@example.org', $pkey
         );
@@ -413,17 +413,17 @@ class UserTest extends TestBase
         $randKey2 = '-'.$this->us->getNewPrivateKey();
         $this->assertFalse(
             $this->us->isPrivateKeyValid($randKey2),
-            'disabled privatekey should return false'
+            'disabled privateKey should return false'
         );
     }
 
 
     public function testLoginPrivateKeyInvalid()
     {
-        /* normal user with enabled privatekey */
+        /* normal user with enabled privateKey */
         $randKey = $this->us->getNewPrivateKey();
         $uid1 = $this->addUser('testusername', 'passw0rd', $randKey);
-        /* user that has disabled privatekey */
+        /* user that has disabled privateKey */
         $randKey2 = '-'.$this->us->getNewPrivateKey();
         $uid2 = $this->addUser('seconduser', 'passw0RD', $randKey2);
 
@@ -436,10 +436,10 @@ class UserTest extends TestBase
 
     public function testLoginPrivateKeyValidEnabledKey()
     {
-        /* normal user with enabled privatekey */
+        /* normal user with enabled privateKey */
         $randKey = $this->us->getNewPrivateKey();
         $uid1 = $this->addUser('testusername', 'passw0rd', $randKey);
-        /* user that has disabled privatekey */
+        /* user that has disabled privateKey */
         $randKey2 = '-'.$this->us->getNewPrivateKey();
         $uid2 = $this->addUser('seconduser', 'passw0RD', $randKey2);
 
@@ -453,10 +453,10 @@ class UserTest extends TestBase
 
     public function testLoginPrivateKeyInvalidEnabledKey()
     {
-        /* normal user with enabled privatekey */
+        /* normal user with enabled privateKey */
         $randKey = $this->us->getNewPrivateKey();
         $uid1 = $this->addUser('testusername', 'passw0rd', $randKey);
-        /* user that has disabled privatekey */
+        /* user that has disabled privateKey */
         $randKey2 = '-'.$this->us->getNewPrivateKey();
         $uid2 = $this->addUser('seconduser', 'passw0RD', $randKey2);
 
@@ -470,10 +470,10 @@ class UserTest extends TestBase
 
     public function testLoginPrivateKeyValidDisabledKey()
     {
-        /* normal user with enabled privatekey */
+        /* normal user with enabled privateKey */
         $randKey = $this->us->getNewPrivateKey();
         $uid1 = $this->addUser('testusername', 'passw0rd', $randKey);
-        /* user that has disabled privatekey */
+        /* user that has disabled privateKey */
         $randKey2 = '-'.$this->us->getNewPrivateKey();
         $uid2 = $this->addUser('seconduser', 'passw0RD', $randKey2);
 
@@ -491,10 +491,10 @@ class UserTest extends TestBase
 
     public function testLoginPrivateKeyInvalidDisabled()
     {
-        /* normal user with enabled privatekey */
+        /* normal user with enabled privateKey */
         $randKey = $this->us->getNewPrivateKey();
         $uid1 = $this->addUser('testusername', 'passw0rd', $randKey);
-        /* user that has disabled privatekey */
+        /* user that has disabled privateKey */
         $randKey2 = '-'.$this->us->getNewPrivateKey();
         $uid2 = $this->addUser('seconduser', 'passw0RD', $randKey2);
 
index 1e1f4eb280a7f3639f136dc0ab205aa16a2baddf..ae82118e22386d5f10c2347acc3ad584354d518d 100755 (executable)
@@ -92,7 +92,7 @@ class www_bookmarksTest extends TestBaseApi
         $this->assertEquals(
             2, count($elements), 'Number of Links in Head not correct'
         );
-        $this->assertContains('privatekey=', (string)$elements[1]['href']);
+        $this->assertContains('privateKey=', (string)$elements[1]['href']);
     }//end testVerifyPrivateRSSLinkExists
 
 
@@ -121,7 +121,7 @@ class www_bookmarksTest extends TestBaseApi
         $this->assertEquals(
             1, count($elements), 'Number of Links in Head not correct'
         );
-        $this->assertNotContains('privatekey=', (string)$elements[0]['href']);
+        $this->assertNotContains('privateKey=', (string)$elements[0]['href']);
     }//end testVerifyPrivateRSSLinkDoesNotExist
 
 }//end class www_bookmarksTest
index 18cb75ab662b66e0edc28f86e010de56adbf6990..503fd1f989656a6b155a47482d4d91a8dde9f078 100644 (file)
@@ -26,7 +26,7 @@ class www_indexTest extends TestBaseApi
 
         $elements = $x->xpath('//ns:link[@rel="alternate" and @type="application/rss+xml"]');
         $this->assertEquals(2, count($elements), 'Number of Links in Head not correct');
-        $this->assertContains('privatekey=', (string)$elements[1]['href']);
+        $this->assertContains('privateKey=', (string)$elements[1]['href']);
     }//end testVerifyPrivateRSSLinkExists
 
 
@@ -50,7 +50,7 @@ class www_indexTest extends TestBaseApi
 
         $elements = $x->xpath('//ns:link[@rel="alternate" and @type="application/rss+xml"]');
         $this->assertEquals(1, count($elements), 'Number of Links in Head not correct');
-        $this->assertNotContains('privatekey=', (string)$elements[0]['href']);
+        $this->assertNotContains('privateKey=', (string)$elements[0]['href']);
     }//end testVerifyPrivateRSSLinkDoesNotExist
 
 
index 75e4363e0384419927f0a9c9d5967c034d542ac8..71d0198c472fdc418e0357d02baaabeb718608c8 100644 (file)
@@ -78,7 +78,7 @@ class www_rssTest extends TestBaseApi
             null, 'private bookmark'
         );
 
-        $req = $this->getRequest('?privatekey=' . $privateKey);
+        $req = $this->getRequest('?privateKey=' . $privateKey);
         $response_body = $req->send()->getBody();
 
         $rss = simplexml_load_string($response_body);
@@ -103,7 +103,7 @@ class www_rssTest extends TestBaseApi
             null, 'private bookmark'
         );
 
-        $req = $this->getRequest('/' . $username . '?privatekey=' . $privateKey);
+        $req = $this->getRequest('/' . $username . '?privateKey=' . $privateKey);
         $response_body = $req->send()->getBody();
 
         $rss = simplexml_load_string($response_body);
@@ -129,7 +129,7 @@ class www_rssTest extends TestBaseApi
             null, 'private bookmark'
         );
 
-        $req = $this->getRequest('/' . $username . '?privatekey=' . $privateKey);
+        $req = $this->getRequest('/' . $username . '?privateKey=' . $privateKey);
         $cookies = $req->setCookieJar()->getCookieJar();
         $response_body = $req->send()->getBody();
 
index 44119db4c86af59a908e4f6d80fda2b5b8103e76..7056fa6e0d6d9a4d15d49cca26a04bc949bd5937 100644 (file)
@@ -276,7 +276,7 @@ if ($templatename == 'editbookmark.tpl') {
                 $tplVars['rsschannels'],
                 array(
                     filter($sitename . $rssTitle. sprintf(T_(': (private) ')) . $currentUsername),
-                    createURL('rss', filter($currentUsername, 'url') . '?sort='.getSortOrder().'&amp;privatekey='.$currentUser->getPrivateKey())
+                    createURL('rss', filter($currentUsername, 'url') . '?sort='.getSortOrder().'&amp;privateKey='.$currentUser->getPrivateKey())
                 )
             );
         }
index 2fa21f87b6b529b4e877c7c98ed5c2ac873b2e15..f270f73bf5ca13e7a17fbb8f9d037218bc76ea6e 100644 (file)
@@ -52,7 +52,7 @@ if ($userservice->isLoggedOn()) {
             $tplVars['rsschannels'],
             array(
                 filter(sprintf(T_('%s: Recent bookmarks (+private) %s'), $sitename, $currentUsername)),
-                createURL('rss', filter($currentUsername, 'url') . '?sort='.getSortOrder().'&amp;privatekey='.$currentUser->getPrivateKey())
+                createURL('rss', filter($currentUsername, 'url') . '?sort='.getSortOrder().'&amp;privateKey='.$currentUser->getPrivateKey())
             )
         );
     }
index b8f694830a79142abe8a671abbb0343b795b1c85..d888726eda12bb9ca98248e3447e553f10106457 100644 (file)
@@ -64,9 +64,9 @@ if (!isset($rssEntries) || $rssEntries <= 0) {
     $rssEntries = $maxRssEntries;
 }
 
-$privatekey = null;
-if (isset($_GET['privatekey'])) {
-    $privatekey = $_GET['privatekey'];
+$privateKey = null;
+if (isset($_GET['privateKey'])) {
+    $privateKey = $_GET['privateKey'];
 }
 
 $userid    = null;
@@ -83,10 +83,10 @@ if ($user && $user != 'all') {
     } else {
         if ($userinfo = $userservice->getUserByUsername($user)) {
             $userid =& $userinfo[$userservice->getFieldName('primary')];
-            /* if user is not logged in and has valid privatekey */
+            /* if user is not logged in and has valid privateKey */
             if (!$userservice->isLoggedOn()) {
-                if ($privatekey != null) {
-                    if (!$userservice->loginPrivateKey($privatekey)) {
+                if ($privateKey != null) {
+                    if (!$userservice->loginPrivateKey($privateKey)) {
                         $tplVars['error'] = sprintf(T_('Failed to Autenticate User with username %s using private key'), $user);
                         header('Content-type: text/html; charset=utf-8');
                         $templateservice->loadTemplate('error.404.tpl', $tplVars);
@@ -106,8 +106,8 @@ if ($user && $user != 'all') {
     }
     $pagetitle .= ": ". $user;
 } else {
-    if ($privatekey != null) {
-        if (!$userservice->loginPrivateKey($privatekey)) {
+    if ($privateKey != null) {
+        if (!$userservice->loginPrivateKey($privateKey)) {
             $tplVars['error'] = sprintf(T_('Failed to Autenticate User with username %s using private key'), $user);
             header('Content-type: text/html; charset=utf-8');
             $templateservice->loadTemplate('error.404.tpl', $tplVars);
index 09725e4194480ec1b5af1db17bca2729d4af9a9d..fca8a04e504d122f6a5ad1e8d6e0c1aac17a6454 100644 (file)
@@ -77,7 +77,7 @@ if ($userservice->isLoggedOn()) {
             $tplVars['rsschannels'],
             array(
                 filter($sitename .': Tags: '. $cat . sprintf(T_(': (private) ')) . $currentUsername),
-                createURL('rss', filter($currentUsername, 'url') . '?sort='.getSortOrder().'&amp;privatekey='.$currentUser->getPrivateKey())
+                createURL('rss', filter($currentUsername, 'url') . '?sort='.getSortOrder().'&amp;privateKey='.$currentUser->getPrivateKey())
             )
         );
     }