2013-12-17 26 views
2

我想知道有無論如何我可以讓人們從一個正常的PHP頁面登錄到SquirelMail/Roundcube等?外部登錄到Web郵件

所以我會有一個登錄佈局設置,如果他們填寫他們的電子郵件和密碼,它會將他們記錄到SquirellMail/Roundcube?他們不能使用SquirelMail的登錄頁面,而是使用我創建的登錄頁面。

這是可能的,如果是的話,怎麼樣?

+1

創建表單在roundcube上設置的操作(例如)登錄腳本? – SpiderLinked

+0

您應該能夠創建提交到外部位置的表單。但是有一些問題:1)外部網站可以通過向頁面添加隱藏的令牌來防止這種情況發生,有時爲了防止跨站點請求僞造攻擊,以及2)如果某人的密碼爲外部網站永遠不會進入我的網站 - 沒有人可以指責我劫持它,這種方式。看起來Jervelund找到了一個供應商特定的解決方案,所以我願意這樣做。 –

回答

1

Roundcube

index.php.diff

104,105c104,105 
< if ($auth['valid'] && !$auth['abort'] && 
<  $RCMAIL->login($auth['user'], $auth['pass'], $auth['host'], $auth['cookiecheck']) 
--- 
> if (
>  $RCMAIL->login($auth['user'], $auth['pass']) 
308d307 
< 

的login.html(測試)

<!-- It's just an example. You need to use these inputs in your own form. --> 
<!-- Follow me at https://github.com/afsec --> 
<!-- I'm looking for a job. --> 
<form name="form" action="http://webmail.example.com/" method="post"> 
    <input type="hidden" name="_task" value="login"> 
    <input type="hidden" name="_action" value="login"> 
    <input type="hidden" name="_timezone" id="rcmlogintz" value="_default_"> 
    <input type="hidden" name="_url" id="rcmloginurl"> 
    <input name="_user" id="rcmloginuser" size="40" autocapitalize="off" autocomplete="off" type="text"> 
    <input name="_pass" id="rcmloginpwd" size="40" autocapitalize="off" autocomplete="off" type="password"> 
    <input type="submit" class="button mainaction" value="Enter" /></p> 
</form> 
+0

Greate,thx夥計! – siavolt