What file is Zend_Registry in


#1

I am trying to figure out what file the class Zend_Registry is in.

Can anyone tell me?


(vipsoft) #2

libs/Zend/Registry.php


#3

ahhhh thanks!


#4

hmm I still can’t find what I am looking for I hope someone can help.

What I am looking for is where is this function defined:

Zend_Registry::get(‘access’)->reloadAccess();

All I need to know is how to reload auth tokens once I manually add a user.


(vipsoft) #5

core/Access.php


#6

Thanks for your help.

That leads me to a dead in too.

Here is my problem…I wrote a shell script to add users to the database

But when I do that no one can login.

I am pretty sure I have the token auth hash the same way adduser() does the only thing different my shell script does is than adduser() does is the line with Zend_Registry::get(‘access’)->reloadAccess(); in adduser.

So what is Piwik doing to add a new user that I am not?


(vipsoft) #7

Besides the fact that you’re doing it the hard way, there’s the possibility we’ll change how passwords and tokens are hashed in the future.

You should use the REST API to add users, e.g.,


#!/bin/sh
PHP_BIN=/usr/bin/php
PIWIK_PATH=/path/to/piwik/index.php
...
CMD="$PHP_BIN -q $PIWIK_PATH -- module=API&method=UsersManager.addUser&userLogin=$USERLOGIN&password=$PASSWORD&email=$EMAIL&token_auth=$SUPERUSER_TOKEN_AUTH"
$CMD

(PHP examples can be found in the misc folder.)


#8

Hey, that was exactly what I was looking for, thanks for the info vipsoft !


#9

thanks vipsoft…

is there a way to not return as XML?


(vipsoft) #10

Use the format= parameter, eg format=json.

Refer to the Dev Zone wiki for more info.