在cakephp spark-plug中出现致命错误

时间:2012-01-04 10:09:37

标签: cakephp

当我在cakephp工作并整合tumblr api时,它会进入tumblr网站提供访问权限,当它返回我的网站时它会给我以下错误:

Fatal error: Uncaught exception 'Exception' with message 'User::authsomeLogin() is not implemented!' in /var/www/vhosts/narolainfotech.com/subdomains/demo/httpdocs/staggr/app/plugins/spark_plug/controllers/components/authsome.php:81 
Stack trace:
 #0 /var/www/vhosts/narolainfotech.com/subdomains/demo/httpdocs/staggr/app/plugins/spark_plug/controllers/components/authsome.php(196): AuthsomeComponent->login('guest') 
 #1 /var/www/vhosts/narolainfotech.com/subdomains/demo/httpdocs/staggr/app/plugins/spark_plug/controllers/components/authsome.php(148): AuthsomeComponent->__useGuestAccount() 
 #2 /var/www/vhosts/narolainfotech.com/subdomains/demo/httpdocs/staggr/app/plugins/spark_plug/controllers/components/authsome.php(60): AuthsomeComponent->__getActiveUser() 
 #3 /var/www/vhosts/narolainfotech.com/subdomains/demo/httpdocs/staggr/app/plugins/spark_plug/config/config.php(71): AuthsomeComponent->get() 
 #4 /var/www/vhosts/narolainfotech.com/subdomains/demo/httpdocs/staggr/app/app_controller.php(11): SparkPlugIt(Object(TumblrController)) in /var/www/vhosts/narolainfotech.com/subdomains/demo/httpdocs/staggr/app/plugins/spark_plug/controllers/components/authsome.php on line 81

我试图寻找解决方案我得到的东西对我没有帮助,有些问题甚至没有回答任何解决方案。

我知道为什么会出现这个错误。这只是因为在回调网址中我得到了这个

http://mysite/tumblr/tumblr_token/?oauth_token=aHOVZIP16c8XJmBQz2ijOW47dgwjpnLanadfDYFQbbBvc7C9Yi&oauth_verifier=c6fvmTsPAdz4TOL57FywrZP0zRoQfBTABiaFsilyUZqjhgiCeZ

实际上这个错误只是因为当会话从tumblr返回到我的站点时它会被销毁,所以如何恢复该会话。

所以任何人都可以帮助我.... 在此先感谢...

1 个答案:

答案 0 :(得分:0)

您可以尝试一些solutions listed here

该页面的潜在修复程序由Steinkel提供:

public function login($type = 'credentials', $credentials = null) {

        $user = array();
        if ($type != 'guest'){

            $userModel = $this->__getUserModel();

            $args = func_get_args();
            if (!method_exists($userModel, 'authsomeLogin')) {
                throw new Exception(
                $userModel->alias.'::authsomeLogin() is not implemented! in model '
                );
            }

            if (!is_string($type) && is_null($credentials)) {
                $credentials = $type;
                $type = 'credentials';
            }

            $user = $userModel->authsomeLogin($type, $credentials);
        }
        Configure::write($this->settings['configureKey'], $user);
        $this->Session->write($this->settings['sessionKey'], $user);
        return $user;
    }