2013-06-26 33 views

回答

1

這可能是您需要的插件,sfDoctrineGuardLoginHistoryPlugin,並允許擴展您保存的信息。

檢查更多插件here

看看插件的代碼,你只需要更改以下文件:PluginUserLoginHistoryTable.class.php

添加的功能writeLoginHistorycreateHistoryEntry的信息,你想:

writeLoginHistory(sfEvent $event) { 
//... same code than in the plugin 
//lets save module and action 
    if (!isset($request)) 
    { 
    $sActionName = sfContext::getInstance()->getActionName(); 
    $sModuleName = sfContext::getInstance()->getModuleName(); 
    } 
    else 
    { 
    if (isset($request["module"])) 
    { 
     $sActionName = $request["action"]; 
     $sModuleName = $request["module"]; 
    } 
    } 

    //get values from the http bar URL 
    if (!isset($sModuleName)) 
    { 
    $sFullURL = sfContext::getInstance()->getRouting()->getCurrentInternalUri(); 
    ///... strip action and module name from the above URL 
    } 
} 

記住傳遞這些值用於創建HistoryHandoryEntry函數,並用更多的輸入值更新該函數以保存。

+0

謝謝,這正是我一直在尋找的東西,我閱讀了文檔,但是你能寫一個關於如何保存'module/action'的例子嗎?我的意思是在哪裏或更好如何獲得這部分 – Reynier

+0

編輯上面的帖子來保存操作和模塊,檢查插件信息以獲取更多更改。 – xtrm