]> git.wh0rd.org - tt-rss.git/blobdiff - plugins/instances/init.php
add a wrapper for standard error codes returned by backend, also add explanation...
[tt-rss.git] / plugins / instances / init.php
index d59e17ffdf8b57254420badabf65e0c3faa0027d..b23f45a0184331a15ee0637dedb8878eedfc2b65 100644 (file)
@@ -384,7 +384,7 @@ class Instances extends Plugin implements IHandler {
 
                        print json_encode(array("feeds" => $feeds));
                } else {
-                       print json_encode(array("error" => array("code" => 6)));
+                       print error_json(6);
                }
        }
 
@@ -407,7 +407,7 @@ class Instances extends Plugin implements IHandler {
 
                print "<hr/>";
 
-               $access_key = sha1(uniqid(rand(), true));
+               $access_key = uniqid(rand(), true);
 
                /* Access key */
 
@@ -439,11 +439,14 @@ class Instances extends Plugin implements IHandler {
        }
 
        function genHash() {
-               $hash = sha1(uniqid(rand(), true));
+               $hash = uniqid(base_convert(rand(), 10, 36));
 
                print json_encode(array("hash" => $hash));
        }
 
+       function api_version() {
+               return 2;
+       }
 
 }
 ?>