プロジェクト

全般

プロフィール

QA #282

奈良 裕記 さんが4年以上前に更新

h3. ■現象/要望 

 ログインIDにスペースを追加したい。 
 ADでは設定できる。 
 http://www.redmine.org/issues/811 Username validation - allow spaces... 

 h3. ■解決策 

 app/models/user.rbのvalidation指定を変更すれば対応できる、 

 変更前 
 <pre> 
 validates_format_of :login, :with => /^[a-z0-9_\-@\.]*$/i 
 </pre> 

 変更後(0-9の直後にスペース有) 
 <pre> 
 validates_format_of :login, :with => /^[a-z0-9 _\-@\.]*$/i 
 </pre> 

 独語でumlauts も必要な場合 
 <pre> 
 validates_format_of :login, :with => /^[a-z0-9_ äüöéßÄÜÖ\-@\.]*$/iu 
 </pre> 

 h3. ■対応状況 

 ソースパッチで対応可 

 h3. ■補足 

 文化の差異というか、、 

 http://www.redmine.org/issues/811     Username validation - allow spaces... 
 http://www.redmine.org/issues/6166    Support german umlauts and whitespaces in login string 
 http://www.redmine.org/issues/10810 Allow Login IDs with spaces in them 
 
 WindowsのログインIDに全角文字を使ったことが原因のトラブルを見た事はあります。 
 余計なトラブル起こしたくないので、共通の半角英数以外はIDに使うべきではないと思いますが。 


 !https://unofficial-redmine.org/matomo/matomo.php?idsite=1&rec=1! 

戻る