From ab492076cb8510d9adbb9e80f8589ac4b6f4a57f Mon Sep 17 00:00:00 2001 From: Spen Date: Thu, 26 Sep 2013 15:31:31 +0800 Subject: [PATCH 1/8] sso server for ntu mb server site --- app/controllers/saml_logins_controller.rb | 34 +++++++++++++++++++++++ config/list.yml | 29 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 app/controllers/saml_logins_controller.rb diff --git a/app/controllers/saml_logins_controller.rb b/app/controllers/saml_logins_controller.rb new file mode 100644 index 000000000..8a999cf5a --- /dev/null +++ b/app/controllers/saml_logins_controller.rb @@ -0,0 +1,34 @@ +class SamlLoginsController < ApplicationController + + require "net/http" + require "uri" + require 'rexml/document' + include REXML + + def index + + if params[:wa] == "wsignoutcleanup1.0" #logout + + redirect_to :root + + else #login + + + @wresult = params[:wresult] + @wctx = params[:wctx] + + @main_url = LIST[:sites][@wctx]['url'] + @main_public_key = LIST[:sites][@wctx]['key'] + + @doc = REXML::Document.new @wresult + + public_key = OpenSSL::PKey::RSA.new(@main_public_key) + encrypted_data = public_key.public_encrypt(@doc.elements["//saml:AttributeValue"].text) + + redirect_to "http://#{@main_url}/user_login?" + { :wresult => encrypted_data }.to_param + + end + + end + +end diff --git a/config/list.yml b/config/list.yml index c49de9f45..f20eb6e8b 100644 --- a/config/list.yml +++ b/config/list.yml @@ -79,3 +79,32 @@ default_widget_style: - style3 - style4 - style5 + +sites: + www: + url: www.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmUuz5i/f9PCacIiTADln\na5xpbNh3tMwNSpnMZDa9FsGlw6/pKCkb5VuiusI7on8eZJGyneOrJ2L5tFael4pG\n0xmRMJnPm0FCaFjVO43Ktclehy5zIY7YJqqZo04j95oJrUBwAcB1xESpCx7atdpD\naFGdCtGQia+q/2cRSMic6JSALUtR3l1Xc5FCpC8n9DeYVOsOc4uO3MNuPvZ3MWPe\njULW4kojYcPL/2aHypi0iQKNm3Kss7mTW6/rsKNyhpds1YvdSqkak+QjqgR7hRDA\nFbYPNx4RL/o5RsxW12po7DdttsMHru0btrt+3Uw6TyqU+5cPcM6WJf2CV1/Fh1zm\njwIDAQAB\n-----END PUBLIC KEY-----\n" + ba: + url: ba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsiVjWXc2OmyxK1O/N7R2\nsbhop1o4XStsxwcGm9AQNekoq7F8HEk2ZrSz5+hRln8FK4fT4YajALRQDS0nGUpe\nGmII0bvjQaiUvVvg7qMdUhdw88543VfPZShXZYjVaa/9JFEdw/+d5gHe5N8gTsde\nYY3KcIz6cECx56L2o5l4SNXYgCJt8aEtKOcsOM2ZDdoxTGJGWPxZaYvyKH9euTdC\nd8N/QGr6fzWcFEsefb1Ftxx417RRfJBFbqDsFIHGSGOPRKXwxL8/4qMDSZhtxHrK\nOdSvQhfF1YAr210TQxgdj/8Pl0PbuY0g8TM+S1izGjanT8vepuye7vUQ2vKRZ36z\nHwIDAQAB\n-----END PUBLIC KEY-----\n" + acc: + url: acc.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmhhNwvOI7hBu0qZfO8rU\nFg2lNw8Fmm5OUXm2Y/cElGaNWFVpRhJJGPQUV3tu9dMECi2n6yMvvgpXXeqYD/hV\nrlApoBb23o7HPg94cBckEO5vWVnZ4ylPS+GodOe+bFdSe4S/tjFY1KOcKN5rGNQQ\nFQ6JkWoQPBXcIoI4TqJVVAkjd8/x9jMRtK9ZzGGiRFhsbcP/A67kvz0fUsdMt4t1\nHmQJbCa2ONzJ8AGX1oTeHwXGz9ZPVstenci4o8lhwu1Jzim1UryW/XaPcYFH6wKm\nKwRAKJvn8awEvW4fzwD5fwI3u7cu19niT+KQAvDjV3HFuqnqu7LETCkr36hy30Hm\nIwIDAQAB\n-----END PUBLIC KEY-----\n" + finance: + url: finance.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxvRR2ay3HNjq/5rcGlBc\n2nFbQwCQK4nR/GqOUFAwdgWEIivwMALYWPQsNuU90RJqm0HkwxvdLXy/XRZfLSVC\nA5D3JtGmpstJKK7A1jOkP5sj54zs8NMnm2zrm9/YDrUmxUr58OOmsCIjiDXQ0PW+\nIR34FOde6yXgwriPUq2DjTo2UgujNPoNeICGmtTTV+YzVdOZmNqfRVnCpfUUnMsN\nDxzL8K2VzGa7KGJeCe5NEwCdJZ8FApMKUJORpCao9jR62dhZ0GKQpMqvO3c/aHxI\nWY+wnuzMWAZl96hIQc4ksnl7hcd2y5WSQZZS7OBdeSxumqJBqgCd6ITBhrzC5gSv\nCQIDAQAB\n-----END PUBLIC KEY-----\n" + ib: + url: ib.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzfoOcLyW3q7bYXArXEBC\nl62pLW7Yg0zyj5blWjU/DnIwxX6B8q48HfubDWQRGgHJsxCsGVrPwhUNEcmfS20q\nUlTBhx4Qt6qHXQYX0jBZbNg7fr2rbwNlbYovMUxF28dcik8K+eKz0fP2NH1lV4BS\ngDb9Nd/gNXozO67/MSrTCXXBKx8andlmVxhJSC8zQcQ4WXPpDhmTB0AvqUcRm/z7\nbLeIntibt6ke3/BVeixgu1Cf4u1y01+EsJ1sAnJzD+cSrq2tu5ccstbRfY5crY3v\n9YFQ3M9LrYV0fi91LhNt6xPNEvvQuZ21/Wwd9DL4D/7Hg55upcolfTxB3J83cTDg\niwIDAQAB\n-----END PUBLIC KEY-----\n" + im: + url: im.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy1o15uvdBKra9LQsjnRL\nyaJ2ZTOLlaS0ICu/RkDWNTz4gbwKhAvxvS2Om9O85MiZKaOtS+TgrMePk/zTztZA\nnxrVcVZStzj5//zKuOLAg2DOUH0Bd/uBTjvOkfc6CQrJuu50B1S+GgN08KeZSxw4\nYgKn6I3Dnm8NZfl9foZRnGgpgJSUrv2oN2RWTBqkwey9LbWtZ0yoRdZHZpVDKq50\n4PpqgAibNXy4er06yd9qqWA0wIoPPQIsYhBkDmqkBe+AxTV4hqX8W/M+j3ftA+T9\nsKAhMYJD/sWvXA1LbKwiYn2f2GNo6zECCPdbYVwbwVeRHslt6lL11ZejW7jaXVaA\nAwIDAQAB\n-----END PUBLIC KEY-----\n" + emba: + url: emba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzky+srC6d21nBP54Xtv+\nC6VJgjRolToLaaJKR6+qXW6lTU6/kYexfMiVTahcBtSooCDj137L/qn4NJpl/2UF\nXrx45n7FWWrXWJhlec6bh4Lg+wGcJrSDGF3GXhLD6T/0o++ep51zt5a6R3LW+WCg\nAUYzc6lWqSpKF/5Z3GfI4/jvNqrZLEoRtTR19WCjdO5J819XxUv3fW7TDx+XJ3kK\n9OsZWT81R7oushb2HFnGj0HJjwm5yCTFdWTzk6X/R0dAmg8lLcSDpeH1aq0YO/RB\nWycZEgIuV42eTaEg9aYbVnS7F2y8gIQjoVjlJF3VCsntzsaFpAEgXysla826Pna+\njQIDAQAB\n-----END PUBLIC KEY-----\n" + ntugmba: + url: ntugmba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs4WtrGLgj2FEZx+NnHzb\nK1HJ+V3qCJ7jIFH7mboeAjEPrAMLeFIdV4MvoasPALxuoo34oZl1NK6vYnfic5xk\nhV956QIzhB3vd4KDu1zbuYQO3ojlBSP3mbJPyHT6fKSkjLjKy0R5HEeT1+yLizC1\nMCPVBiP7mpaYIKPwfmMXFLA8GQxwBO2VpWpQD7jzd/+UWEXjKoK5t2uoMDL0k0w0\naffMcZKNntENXTRgnTq4iK39ayT95iXw81FH+LyEo5XtiHYsO2mhOPc9j5tU3GCO\nKwFmXPlh2+B1YwV+lkfCqpdT37Z3lLNFmw7sYidMvD3xIiFBsPKspoa1qlURmnuH\nvQIDAQAB\n-----END PUBLIC KEY-----\n" + ia: + url: ia.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvlVvwFF+k6/UI9+hhTEi\n032nTnEG/8l3ARfpSsTPwijsyk+e8Utjq3sslHVGlWzmT74KYHoMwNDYXiAH2wpS\n4k+vUugOPYNkY46smDG5oCGVVbmCORzzpZsccpXhFGft378NhNiTRNhk4DBMrFwb\nlALdd9sUDbqcc+PBJIW3KXD66+rcyImHpkEaa8t0rkAd1ZIkfLbXyQWikvOMWYvJ\n3K2+N/vVInAbVOmBwZgK0iP7ZvwvwR/li0nAkdD12jgvgrR6gP2pC+qyH15J2zib\nEz8aLweNBYq/BXGxtWxioFHif22v9LUj1fkAFqEoTwVCIGDdXn2/R9febBkSSPuL\ngQIDAQAB\n-----END PUBLIC KEY-----\n" From 7dc8250a739d15de0668b7a52d1c84ee107ffe19 Mon Sep 17 00:00:00 2001 From: Spen Date: Thu, 26 Sep 2013 15:31:31 +0800 Subject: [PATCH 2/8] sso server for ntu mb server site --- app/controllers/saml_logins_controller.rb | 34 +++++++++++++++++++++++ config/list.yml | 29 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 app/controllers/saml_logins_controller.rb diff --git a/app/controllers/saml_logins_controller.rb b/app/controllers/saml_logins_controller.rb new file mode 100644 index 000000000..8a999cf5a --- /dev/null +++ b/app/controllers/saml_logins_controller.rb @@ -0,0 +1,34 @@ +class SamlLoginsController < ApplicationController + + require "net/http" + require "uri" + require 'rexml/document' + include REXML + + def index + + if params[:wa] == "wsignoutcleanup1.0" #logout + + redirect_to :root + + else #login + + + @wresult = params[:wresult] + @wctx = params[:wctx] + + @main_url = LIST[:sites][@wctx]['url'] + @main_public_key = LIST[:sites][@wctx]['key'] + + @doc = REXML::Document.new @wresult + + public_key = OpenSSL::PKey::RSA.new(@main_public_key) + encrypted_data = public_key.public_encrypt(@doc.elements["//saml:AttributeValue"].text) + + redirect_to "http://#{@main_url}/user_login?" + { :wresult => encrypted_data }.to_param + + end + + end + +end diff --git a/config/list.yml b/config/list.yml index c49de9f45..f20eb6e8b 100644 --- a/config/list.yml +++ b/config/list.yml @@ -79,3 +79,32 @@ default_widget_style: - style3 - style4 - style5 + +sites: + www: + url: www.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmUuz5i/f9PCacIiTADln\na5xpbNh3tMwNSpnMZDa9FsGlw6/pKCkb5VuiusI7on8eZJGyneOrJ2L5tFael4pG\n0xmRMJnPm0FCaFjVO43Ktclehy5zIY7YJqqZo04j95oJrUBwAcB1xESpCx7atdpD\naFGdCtGQia+q/2cRSMic6JSALUtR3l1Xc5FCpC8n9DeYVOsOc4uO3MNuPvZ3MWPe\njULW4kojYcPL/2aHypi0iQKNm3Kss7mTW6/rsKNyhpds1YvdSqkak+QjqgR7hRDA\nFbYPNx4RL/o5RsxW12po7DdttsMHru0btrt+3Uw6TyqU+5cPcM6WJf2CV1/Fh1zm\njwIDAQAB\n-----END PUBLIC KEY-----\n" + ba: + url: ba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsiVjWXc2OmyxK1O/N7R2\nsbhop1o4XStsxwcGm9AQNekoq7F8HEk2ZrSz5+hRln8FK4fT4YajALRQDS0nGUpe\nGmII0bvjQaiUvVvg7qMdUhdw88543VfPZShXZYjVaa/9JFEdw/+d5gHe5N8gTsde\nYY3KcIz6cECx56L2o5l4SNXYgCJt8aEtKOcsOM2ZDdoxTGJGWPxZaYvyKH9euTdC\nd8N/QGr6fzWcFEsefb1Ftxx417RRfJBFbqDsFIHGSGOPRKXwxL8/4qMDSZhtxHrK\nOdSvQhfF1YAr210TQxgdj/8Pl0PbuY0g8TM+S1izGjanT8vepuye7vUQ2vKRZ36z\nHwIDAQAB\n-----END PUBLIC KEY-----\n" + acc: + url: acc.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmhhNwvOI7hBu0qZfO8rU\nFg2lNw8Fmm5OUXm2Y/cElGaNWFVpRhJJGPQUV3tu9dMECi2n6yMvvgpXXeqYD/hV\nrlApoBb23o7HPg94cBckEO5vWVnZ4ylPS+GodOe+bFdSe4S/tjFY1KOcKN5rGNQQ\nFQ6JkWoQPBXcIoI4TqJVVAkjd8/x9jMRtK9ZzGGiRFhsbcP/A67kvz0fUsdMt4t1\nHmQJbCa2ONzJ8AGX1oTeHwXGz9ZPVstenci4o8lhwu1Jzim1UryW/XaPcYFH6wKm\nKwRAKJvn8awEvW4fzwD5fwI3u7cu19niT+KQAvDjV3HFuqnqu7LETCkr36hy30Hm\nIwIDAQAB\n-----END PUBLIC KEY-----\n" + finance: + url: finance.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxvRR2ay3HNjq/5rcGlBc\n2nFbQwCQK4nR/GqOUFAwdgWEIivwMALYWPQsNuU90RJqm0HkwxvdLXy/XRZfLSVC\nA5D3JtGmpstJKK7A1jOkP5sj54zs8NMnm2zrm9/YDrUmxUr58OOmsCIjiDXQ0PW+\nIR34FOde6yXgwriPUq2DjTo2UgujNPoNeICGmtTTV+YzVdOZmNqfRVnCpfUUnMsN\nDxzL8K2VzGa7KGJeCe5NEwCdJZ8FApMKUJORpCao9jR62dhZ0GKQpMqvO3c/aHxI\nWY+wnuzMWAZl96hIQc4ksnl7hcd2y5WSQZZS7OBdeSxumqJBqgCd6ITBhrzC5gSv\nCQIDAQAB\n-----END PUBLIC KEY-----\n" + ib: + url: ib.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzfoOcLyW3q7bYXArXEBC\nl62pLW7Yg0zyj5blWjU/DnIwxX6B8q48HfubDWQRGgHJsxCsGVrPwhUNEcmfS20q\nUlTBhx4Qt6qHXQYX0jBZbNg7fr2rbwNlbYovMUxF28dcik8K+eKz0fP2NH1lV4BS\ngDb9Nd/gNXozO67/MSrTCXXBKx8andlmVxhJSC8zQcQ4WXPpDhmTB0AvqUcRm/z7\nbLeIntibt6ke3/BVeixgu1Cf4u1y01+EsJ1sAnJzD+cSrq2tu5ccstbRfY5crY3v\n9YFQ3M9LrYV0fi91LhNt6xPNEvvQuZ21/Wwd9DL4D/7Hg55upcolfTxB3J83cTDg\niwIDAQAB\n-----END PUBLIC KEY-----\n" + im: + url: im.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy1o15uvdBKra9LQsjnRL\nyaJ2ZTOLlaS0ICu/RkDWNTz4gbwKhAvxvS2Om9O85MiZKaOtS+TgrMePk/zTztZA\nnxrVcVZStzj5//zKuOLAg2DOUH0Bd/uBTjvOkfc6CQrJuu50B1S+GgN08KeZSxw4\nYgKn6I3Dnm8NZfl9foZRnGgpgJSUrv2oN2RWTBqkwey9LbWtZ0yoRdZHZpVDKq50\n4PpqgAibNXy4er06yd9qqWA0wIoPPQIsYhBkDmqkBe+AxTV4hqX8W/M+j3ftA+T9\nsKAhMYJD/sWvXA1LbKwiYn2f2GNo6zECCPdbYVwbwVeRHslt6lL11ZejW7jaXVaA\nAwIDAQAB\n-----END PUBLIC KEY-----\n" + emba: + url: emba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzky+srC6d21nBP54Xtv+\nC6VJgjRolToLaaJKR6+qXW6lTU6/kYexfMiVTahcBtSooCDj137L/qn4NJpl/2UF\nXrx45n7FWWrXWJhlec6bh4Lg+wGcJrSDGF3GXhLD6T/0o++ep51zt5a6R3LW+WCg\nAUYzc6lWqSpKF/5Z3GfI4/jvNqrZLEoRtTR19WCjdO5J819XxUv3fW7TDx+XJ3kK\n9OsZWT81R7oushb2HFnGj0HJjwm5yCTFdWTzk6X/R0dAmg8lLcSDpeH1aq0YO/RB\nWycZEgIuV42eTaEg9aYbVnS7F2y8gIQjoVjlJF3VCsntzsaFpAEgXysla826Pna+\njQIDAQAB\n-----END PUBLIC KEY-----\n" + ntugmba: + url: ntugmba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs4WtrGLgj2FEZx+NnHzb\nK1HJ+V3qCJ7jIFH7mboeAjEPrAMLeFIdV4MvoasPALxuoo34oZl1NK6vYnfic5xk\nhV956QIzhB3vd4KDu1zbuYQO3ojlBSP3mbJPyHT6fKSkjLjKy0R5HEeT1+yLizC1\nMCPVBiP7mpaYIKPwfmMXFLA8GQxwBO2VpWpQD7jzd/+UWEXjKoK5t2uoMDL0k0w0\naffMcZKNntENXTRgnTq4iK39ayT95iXw81FH+LyEo5XtiHYsO2mhOPc9j5tU3GCO\nKwFmXPlh2+B1YwV+lkfCqpdT37Z3lLNFmw7sYidMvD3xIiFBsPKspoa1qlURmnuH\nvQIDAQAB\n-----END PUBLIC KEY-----\n" + ia: + url: ia.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvlVvwFF+k6/UI9+hhTEi\n032nTnEG/8l3ARfpSsTPwijsyk+e8Utjq3sslHVGlWzmT74KYHoMwNDYXiAH2wpS\n4k+vUugOPYNkY46smDG5oCGVVbmCORzzpZsccpXhFGft378NhNiTRNhk4DBMrFwb\nlALdd9sUDbqcc+PBJIW3KXD66+rcyImHpkEaa8t0rkAd1ZIkfLbXyQWikvOMWYvJ\n3K2+N/vVInAbVOmBwZgK0iP7ZvwvwR/li0nAkdD12jgvgrR6gP2pC+qyH15J2zib\nEz8aLweNBYq/BXGxtWxioFHif22v9LUj1fkAFqEoTwVCIGDdXn2/R9febBkSSPuL\ngQIDAQAB\n-----END PUBLIC KEY-----\n" From 52baa91234dc01c3c57388947f72d86d431f7ce3 Mon Sep 17 00:00:00 2001 From: Spen Date: Thu, 26 Sep 2013 15:31:31 +0800 Subject: [PATCH 3/8] sso server for ntu mb server site --- app/controllers/saml_logins_controller.rb | 34 +++++++++++++++++++++++ config/list.yml | 29 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 app/controllers/saml_logins_controller.rb diff --git a/app/controllers/saml_logins_controller.rb b/app/controllers/saml_logins_controller.rb new file mode 100644 index 000000000..8a999cf5a --- /dev/null +++ b/app/controllers/saml_logins_controller.rb @@ -0,0 +1,34 @@ +class SamlLoginsController < ApplicationController + + require "net/http" + require "uri" + require 'rexml/document' + include REXML + + def index + + if params[:wa] == "wsignoutcleanup1.0" #logout + + redirect_to :root + + else #login + + + @wresult = params[:wresult] + @wctx = params[:wctx] + + @main_url = LIST[:sites][@wctx]['url'] + @main_public_key = LIST[:sites][@wctx]['key'] + + @doc = REXML::Document.new @wresult + + public_key = OpenSSL::PKey::RSA.new(@main_public_key) + encrypted_data = public_key.public_encrypt(@doc.elements["//saml:AttributeValue"].text) + + redirect_to "http://#{@main_url}/user_login?" + { :wresult => encrypted_data }.to_param + + end + + end + +end diff --git a/config/list.yml b/config/list.yml index c49de9f45..f20eb6e8b 100644 --- a/config/list.yml +++ b/config/list.yml @@ -79,3 +79,32 @@ default_widget_style: - style3 - style4 - style5 + +sites: + www: + url: www.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmUuz5i/f9PCacIiTADln\na5xpbNh3tMwNSpnMZDa9FsGlw6/pKCkb5VuiusI7on8eZJGyneOrJ2L5tFael4pG\n0xmRMJnPm0FCaFjVO43Ktclehy5zIY7YJqqZo04j95oJrUBwAcB1xESpCx7atdpD\naFGdCtGQia+q/2cRSMic6JSALUtR3l1Xc5FCpC8n9DeYVOsOc4uO3MNuPvZ3MWPe\njULW4kojYcPL/2aHypi0iQKNm3Kss7mTW6/rsKNyhpds1YvdSqkak+QjqgR7hRDA\nFbYPNx4RL/o5RsxW12po7DdttsMHru0btrt+3Uw6TyqU+5cPcM6WJf2CV1/Fh1zm\njwIDAQAB\n-----END PUBLIC KEY-----\n" + ba: + url: ba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsiVjWXc2OmyxK1O/N7R2\nsbhop1o4XStsxwcGm9AQNekoq7F8HEk2ZrSz5+hRln8FK4fT4YajALRQDS0nGUpe\nGmII0bvjQaiUvVvg7qMdUhdw88543VfPZShXZYjVaa/9JFEdw/+d5gHe5N8gTsde\nYY3KcIz6cECx56L2o5l4SNXYgCJt8aEtKOcsOM2ZDdoxTGJGWPxZaYvyKH9euTdC\nd8N/QGr6fzWcFEsefb1Ftxx417RRfJBFbqDsFIHGSGOPRKXwxL8/4qMDSZhtxHrK\nOdSvQhfF1YAr210TQxgdj/8Pl0PbuY0g8TM+S1izGjanT8vepuye7vUQ2vKRZ36z\nHwIDAQAB\n-----END PUBLIC KEY-----\n" + acc: + url: acc.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmhhNwvOI7hBu0qZfO8rU\nFg2lNw8Fmm5OUXm2Y/cElGaNWFVpRhJJGPQUV3tu9dMECi2n6yMvvgpXXeqYD/hV\nrlApoBb23o7HPg94cBckEO5vWVnZ4ylPS+GodOe+bFdSe4S/tjFY1KOcKN5rGNQQ\nFQ6JkWoQPBXcIoI4TqJVVAkjd8/x9jMRtK9ZzGGiRFhsbcP/A67kvz0fUsdMt4t1\nHmQJbCa2ONzJ8AGX1oTeHwXGz9ZPVstenci4o8lhwu1Jzim1UryW/XaPcYFH6wKm\nKwRAKJvn8awEvW4fzwD5fwI3u7cu19niT+KQAvDjV3HFuqnqu7LETCkr36hy30Hm\nIwIDAQAB\n-----END PUBLIC KEY-----\n" + finance: + url: finance.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxvRR2ay3HNjq/5rcGlBc\n2nFbQwCQK4nR/GqOUFAwdgWEIivwMALYWPQsNuU90RJqm0HkwxvdLXy/XRZfLSVC\nA5D3JtGmpstJKK7A1jOkP5sj54zs8NMnm2zrm9/YDrUmxUr58OOmsCIjiDXQ0PW+\nIR34FOde6yXgwriPUq2DjTo2UgujNPoNeICGmtTTV+YzVdOZmNqfRVnCpfUUnMsN\nDxzL8K2VzGa7KGJeCe5NEwCdJZ8FApMKUJORpCao9jR62dhZ0GKQpMqvO3c/aHxI\nWY+wnuzMWAZl96hIQc4ksnl7hcd2y5WSQZZS7OBdeSxumqJBqgCd6ITBhrzC5gSv\nCQIDAQAB\n-----END PUBLIC KEY-----\n" + ib: + url: ib.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzfoOcLyW3q7bYXArXEBC\nl62pLW7Yg0zyj5blWjU/DnIwxX6B8q48HfubDWQRGgHJsxCsGVrPwhUNEcmfS20q\nUlTBhx4Qt6qHXQYX0jBZbNg7fr2rbwNlbYovMUxF28dcik8K+eKz0fP2NH1lV4BS\ngDb9Nd/gNXozO67/MSrTCXXBKx8andlmVxhJSC8zQcQ4WXPpDhmTB0AvqUcRm/z7\nbLeIntibt6ke3/BVeixgu1Cf4u1y01+EsJ1sAnJzD+cSrq2tu5ccstbRfY5crY3v\n9YFQ3M9LrYV0fi91LhNt6xPNEvvQuZ21/Wwd9DL4D/7Hg55upcolfTxB3J83cTDg\niwIDAQAB\n-----END PUBLIC KEY-----\n" + im: + url: im.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy1o15uvdBKra9LQsjnRL\nyaJ2ZTOLlaS0ICu/RkDWNTz4gbwKhAvxvS2Om9O85MiZKaOtS+TgrMePk/zTztZA\nnxrVcVZStzj5//zKuOLAg2DOUH0Bd/uBTjvOkfc6CQrJuu50B1S+GgN08KeZSxw4\nYgKn6I3Dnm8NZfl9foZRnGgpgJSUrv2oN2RWTBqkwey9LbWtZ0yoRdZHZpVDKq50\n4PpqgAibNXy4er06yd9qqWA0wIoPPQIsYhBkDmqkBe+AxTV4hqX8W/M+j3ftA+T9\nsKAhMYJD/sWvXA1LbKwiYn2f2GNo6zECCPdbYVwbwVeRHslt6lL11ZejW7jaXVaA\nAwIDAQAB\n-----END PUBLIC KEY-----\n" + emba: + url: emba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzky+srC6d21nBP54Xtv+\nC6VJgjRolToLaaJKR6+qXW6lTU6/kYexfMiVTahcBtSooCDj137L/qn4NJpl/2UF\nXrx45n7FWWrXWJhlec6bh4Lg+wGcJrSDGF3GXhLD6T/0o++ep51zt5a6R3LW+WCg\nAUYzc6lWqSpKF/5Z3GfI4/jvNqrZLEoRtTR19WCjdO5J819XxUv3fW7TDx+XJ3kK\n9OsZWT81R7oushb2HFnGj0HJjwm5yCTFdWTzk6X/R0dAmg8lLcSDpeH1aq0YO/RB\nWycZEgIuV42eTaEg9aYbVnS7F2y8gIQjoVjlJF3VCsntzsaFpAEgXysla826Pna+\njQIDAQAB\n-----END PUBLIC KEY-----\n" + ntugmba: + url: ntugmba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs4WtrGLgj2FEZx+NnHzb\nK1HJ+V3qCJ7jIFH7mboeAjEPrAMLeFIdV4MvoasPALxuoo34oZl1NK6vYnfic5xk\nhV956QIzhB3vd4KDu1zbuYQO3ojlBSP3mbJPyHT6fKSkjLjKy0R5HEeT1+yLizC1\nMCPVBiP7mpaYIKPwfmMXFLA8GQxwBO2VpWpQD7jzd/+UWEXjKoK5t2uoMDL0k0w0\naffMcZKNntENXTRgnTq4iK39ayT95iXw81FH+LyEo5XtiHYsO2mhOPc9j5tU3GCO\nKwFmXPlh2+B1YwV+lkfCqpdT37Z3lLNFmw7sYidMvD3xIiFBsPKspoa1qlURmnuH\nvQIDAQAB\n-----END PUBLIC KEY-----\n" + ia: + url: ia.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvlVvwFF+k6/UI9+hhTEi\n032nTnEG/8l3ARfpSsTPwijsyk+e8Utjq3sslHVGlWzmT74KYHoMwNDYXiAH2wpS\n4k+vUugOPYNkY46smDG5oCGVVbmCORzzpZsccpXhFGft378NhNiTRNhk4DBMrFwb\nlALdd9sUDbqcc+PBJIW3KXD66+rcyImHpkEaa8t0rkAd1ZIkfLbXyQWikvOMWYvJ\n3K2+N/vVInAbVOmBwZgK0iP7ZvwvwR/li0nAkdD12jgvgrR6gP2pC+qyH15J2zib\nEz8aLweNBYq/BXGxtWxioFHif22v9LUj1fkAFqEoTwVCIGDdXn2/R9febBkSSPuL\ngQIDAQAB\n-----END PUBLIC KEY-----\n" From 9fb8c18bf5cf83869373352a9c36ff8b7464defc Mon Sep 17 00:00:00 2001 From: Spen Date: Thu, 26 Sep 2013 15:31:31 +0800 Subject: [PATCH 4/8] sso server for ntu mb server site --- app/controllers/saml_logins_controller.rb | 34 +++++++++++++++++++++++ config/list.yml | 29 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 app/controllers/saml_logins_controller.rb diff --git a/app/controllers/saml_logins_controller.rb b/app/controllers/saml_logins_controller.rb new file mode 100644 index 000000000..8a999cf5a --- /dev/null +++ b/app/controllers/saml_logins_controller.rb @@ -0,0 +1,34 @@ +class SamlLoginsController < ApplicationController + + require "net/http" + require "uri" + require 'rexml/document' + include REXML + + def index + + if params[:wa] == "wsignoutcleanup1.0" #logout + + redirect_to :root + + else #login + + + @wresult = params[:wresult] + @wctx = params[:wctx] + + @main_url = LIST[:sites][@wctx]['url'] + @main_public_key = LIST[:sites][@wctx]['key'] + + @doc = REXML::Document.new @wresult + + public_key = OpenSSL::PKey::RSA.new(@main_public_key) + encrypted_data = public_key.public_encrypt(@doc.elements["//saml:AttributeValue"].text) + + redirect_to "http://#{@main_url}/user_login?" + { :wresult => encrypted_data }.to_param + + end + + end + +end diff --git a/config/list.yml b/config/list.yml index c49de9f45..f20eb6e8b 100644 --- a/config/list.yml +++ b/config/list.yml @@ -79,3 +79,32 @@ default_widget_style: - style3 - style4 - style5 + +sites: + www: + url: www.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmUuz5i/f9PCacIiTADln\na5xpbNh3tMwNSpnMZDa9FsGlw6/pKCkb5VuiusI7on8eZJGyneOrJ2L5tFael4pG\n0xmRMJnPm0FCaFjVO43Ktclehy5zIY7YJqqZo04j95oJrUBwAcB1xESpCx7atdpD\naFGdCtGQia+q/2cRSMic6JSALUtR3l1Xc5FCpC8n9DeYVOsOc4uO3MNuPvZ3MWPe\njULW4kojYcPL/2aHypi0iQKNm3Kss7mTW6/rsKNyhpds1YvdSqkak+QjqgR7hRDA\nFbYPNx4RL/o5RsxW12po7DdttsMHru0btrt+3Uw6TyqU+5cPcM6WJf2CV1/Fh1zm\njwIDAQAB\n-----END PUBLIC KEY-----\n" + ba: + url: ba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsiVjWXc2OmyxK1O/N7R2\nsbhop1o4XStsxwcGm9AQNekoq7F8HEk2ZrSz5+hRln8FK4fT4YajALRQDS0nGUpe\nGmII0bvjQaiUvVvg7qMdUhdw88543VfPZShXZYjVaa/9JFEdw/+d5gHe5N8gTsde\nYY3KcIz6cECx56L2o5l4SNXYgCJt8aEtKOcsOM2ZDdoxTGJGWPxZaYvyKH9euTdC\nd8N/QGr6fzWcFEsefb1Ftxx417RRfJBFbqDsFIHGSGOPRKXwxL8/4qMDSZhtxHrK\nOdSvQhfF1YAr210TQxgdj/8Pl0PbuY0g8TM+S1izGjanT8vepuye7vUQ2vKRZ36z\nHwIDAQAB\n-----END PUBLIC KEY-----\n" + acc: + url: acc.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmhhNwvOI7hBu0qZfO8rU\nFg2lNw8Fmm5OUXm2Y/cElGaNWFVpRhJJGPQUV3tu9dMECi2n6yMvvgpXXeqYD/hV\nrlApoBb23o7HPg94cBckEO5vWVnZ4ylPS+GodOe+bFdSe4S/tjFY1KOcKN5rGNQQ\nFQ6JkWoQPBXcIoI4TqJVVAkjd8/x9jMRtK9ZzGGiRFhsbcP/A67kvz0fUsdMt4t1\nHmQJbCa2ONzJ8AGX1oTeHwXGz9ZPVstenci4o8lhwu1Jzim1UryW/XaPcYFH6wKm\nKwRAKJvn8awEvW4fzwD5fwI3u7cu19niT+KQAvDjV3HFuqnqu7LETCkr36hy30Hm\nIwIDAQAB\n-----END PUBLIC KEY-----\n" + finance: + url: finance.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxvRR2ay3HNjq/5rcGlBc\n2nFbQwCQK4nR/GqOUFAwdgWEIivwMALYWPQsNuU90RJqm0HkwxvdLXy/XRZfLSVC\nA5D3JtGmpstJKK7A1jOkP5sj54zs8NMnm2zrm9/YDrUmxUr58OOmsCIjiDXQ0PW+\nIR34FOde6yXgwriPUq2DjTo2UgujNPoNeICGmtTTV+YzVdOZmNqfRVnCpfUUnMsN\nDxzL8K2VzGa7KGJeCe5NEwCdJZ8FApMKUJORpCao9jR62dhZ0GKQpMqvO3c/aHxI\nWY+wnuzMWAZl96hIQc4ksnl7hcd2y5WSQZZS7OBdeSxumqJBqgCd6ITBhrzC5gSv\nCQIDAQAB\n-----END PUBLIC KEY-----\n" + ib: + url: ib.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzfoOcLyW3q7bYXArXEBC\nl62pLW7Yg0zyj5blWjU/DnIwxX6B8q48HfubDWQRGgHJsxCsGVrPwhUNEcmfS20q\nUlTBhx4Qt6qHXQYX0jBZbNg7fr2rbwNlbYovMUxF28dcik8K+eKz0fP2NH1lV4BS\ngDb9Nd/gNXozO67/MSrTCXXBKx8andlmVxhJSC8zQcQ4WXPpDhmTB0AvqUcRm/z7\nbLeIntibt6ke3/BVeixgu1Cf4u1y01+EsJ1sAnJzD+cSrq2tu5ccstbRfY5crY3v\n9YFQ3M9LrYV0fi91LhNt6xPNEvvQuZ21/Wwd9DL4D/7Hg55upcolfTxB3J83cTDg\niwIDAQAB\n-----END PUBLIC KEY-----\n" + im: + url: im.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy1o15uvdBKra9LQsjnRL\nyaJ2ZTOLlaS0ICu/RkDWNTz4gbwKhAvxvS2Om9O85MiZKaOtS+TgrMePk/zTztZA\nnxrVcVZStzj5//zKuOLAg2DOUH0Bd/uBTjvOkfc6CQrJuu50B1S+GgN08KeZSxw4\nYgKn6I3Dnm8NZfl9foZRnGgpgJSUrv2oN2RWTBqkwey9LbWtZ0yoRdZHZpVDKq50\n4PpqgAibNXy4er06yd9qqWA0wIoPPQIsYhBkDmqkBe+AxTV4hqX8W/M+j3ftA+T9\nsKAhMYJD/sWvXA1LbKwiYn2f2GNo6zECCPdbYVwbwVeRHslt6lL11ZejW7jaXVaA\nAwIDAQAB\n-----END PUBLIC KEY-----\n" + emba: + url: emba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzky+srC6d21nBP54Xtv+\nC6VJgjRolToLaaJKR6+qXW6lTU6/kYexfMiVTahcBtSooCDj137L/qn4NJpl/2UF\nXrx45n7FWWrXWJhlec6bh4Lg+wGcJrSDGF3GXhLD6T/0o++ep51zt5a6R3LW+WCg\nAUYzc6lWqSpKF/5Z3GfI4/jvNqrZLEoRtTR19WCjdO5J819XxUv3fW7TDx+XJ3kK\n9OsZWT81R7oushb2HFnGj0HJjwm5yCTFdWTzk6X/R0dAmg8lLcSDpeH1aq0YO/RB\nWycZEgIuV42eTaEg9aYbVnS7F2y8gIQjoVjlJF3VCsntzsaFpAEgXysla826Pna+\njQIDAQAB\n-----END PUBLIC KEY-----\n" + ntugmba: + url: ntugmba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs4WtrGLgj2FEZx+NnHzb\nK1HJ+V3qCJ7jIFH7mboeAjEPrAMLeFIdV4MvoasPALxuoo34oZl1NK6vYnfic5xk\nhV956QIzhB3vd4KDu1zbuYQO3ojlBSP3mbJPyHT6fKSkjLjKy0R5HEeT1+yLizC1\nMCPVBiP7mpaYIKPwfmMXFLA8GQxwBO2VpWpQD7jzd/+UWEXjKoK5t2uoMDL0k0w0\naffMcZKNntENXTRgnTq4iK39ayT95iXw81FH+LyEo5XtiHYsO2mhOPc9j5tU3GCO\nKwFmXPlh2+B1YwV+lkfCqpdT37Z3lLNFmw7sYidMvD3xIiFBsPKspoa1qlURmnuH\nvQIDAQAB\n-----END PUBLIC KEY-----\n" + ia: + url: ia.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvlVvwFF+k6/UI9+hhTEi\n032nTnEG/8l3ARfpSsTPwijsyk+e8Utjq3sslHVGlWzmT74KYHoMwNDYXiAH2wpS\n4k+vUugOPYNkY46smDG5oCGVVbmCORzzpZsccpXhFGft378NhNiTRNhk4DBMrFwb\nlALdd9sUDbqcc+PBJIW3KXD66+rcyImHpkEaa8t0rkAd1ZIkfLbXyQWikvOMWYvJ\n3K2+N/vVInAbVOmBwZgK0iP7ZvwvwR/li0nAkdD12jgvgrR6gP2pC+qyH15J2zib\nEz8aLweNBYq/BXGxtWxioFHif22v9LUj1fkAFqEoTwVCIGDdXn2/R9febBkSSPuL\ngQIDAQAB\n-----END PUBLIC KEY-----\n" From b415b23db2e9ae7f4c2ca499d0f945a399fac154 Mon Sep 17 00:00:00 2001 From: Spen Date: Thu, 26 Sep 2013 15:31:31 +0800 Subject: [PATCH 5/8] sso server for ntu mb server site --- app/controllers/saml_logins_controller.rb | 34 +++++++++++++++++++++++ config/list.yml | 29 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 app/controllers/saml_logins_controller.rb diff --git a/app/controllers/saml_logins_controller.rb b/app/controllers/saml_logins_controller.rb new file mode 100644 index 000000000..8a999cf5a --- /dev/null +++ b/app/controllers/saml_logins_controller.rb @@ -0,0 +1,34 @@ +class SamlLoginsController < ApplicationController + + require "net/http" + require "uri" + require 'rexml/document' + include REXML + + def index + + if params[:wa] == "wsignoutcleanup1.0" #logout + + redirect_to :root + + else #login + + + @wresult = params[:wresult] + @wctx = params[:wctx] + + @main_url = LIST[:sites][@wctx]['url'] + @main_public_key = LIST[:sites][@wctx]['key'] + + @doc = REXML::Document.new @wresult + + public_key = OpenSSL::PKey::RSA.new(@main_public_key) + encrypted_data = public_key.public_encrypt(@doc.elements["//saml:AttributeValue"].text) + + redirect_to "http://#{@main_url}/user_login?" + { :wresult => encrypted_data }.to_param + + end + + end + +end diff --git a/config/list.yml b/config/list.yml index c49de9f45..f20eb6e8b 100644 --- a/config/list.yml +++ b/config/list.yml @@ -79,3 +79,32 @@ default_widget_style: - style3 - style4 - style5 + +sites: + www: + url: www.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmUuz5i/f9PCacIiTADln\na5xpbNh3tMwNSpnMZDa9FsGlw6/pKCkb5VuiusI7on8eZJGyneOrJ2L5tFael4pG\n0xmRMJnPm0FCaFjVO43Ktclehy5zIY7YJqqZo04j95oJrUBwAcB1xESpCx7atdpD\naFGdCtGQia+q/2cRSMic6JSALUtR3l1Xc5FCpC8n9DeYVOsOc4uO3MNuPvZ3MWPe\njULW4kojYcPL/2aHypi0iQKNm3Kss7mTW6/rsKNyhpds1YvdSqkak+QjqgR7hRDA\nFbYPNx4RL/o5RsxW12po7DdttsMHru0btrt+3Uw6TyqU+5cPcM6WJf2CV1/Fh1zm\njwIDAQAB\n-----END PUBLIC KEY-----\n" + ba: + url: ba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsiVjWXc2OmyxK1O/N7R2\nsbhop1o4XStsxwcGm9AQNekoq7F8HEk2ZrSz5+hRln8FK4fT4YajALRQDS0nGUpe\nGmII0bvjQaiUvVvg7qMdUhdw88543VfPZShXZYjVaa/9JFEdw/+d5gHe5N8gTsde\nYY3KcIz6cECx56L2o5l4SNXYgCJt8aEtKOcsOM2ZDdoxTGJGWPxZaYvyKH9euTdC\nd8N/QGr6fzWcFEsefb1Ftxx417RRfJBFbqDsFIHGSGOPRKXwxL8/4qMDSZhtxHrK\nOdSvQhfF1YAr210TQxgdj/8Pl0PbuY0g8TM+S1izGjanT8vepuye7vUQ2vKRZ36z\nHwIDAQAB\n-----END PUBLIC KEY-----\n" + acc: + url: acc.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmhhNwvOI7hBu0qZfO8rU\nFg2lNw8Fmm5OUXm2Y/cElGaNWFVpRhJJGPQUV3tu9dMECi2n6yMvvgpXXeqYD/hV\nrlApoBb23o7HPg94cBckEO5vWVnZ4ylPS+GodOe+bFdSe4S/tjFY1KOcKN5rGNQQ\nFQ6JkWoQPBXcIoI4TqJVVAkjd8/x9jMRtK9ZzGGiRFhsbcP/A67kvz0fUsdMt4t1\nHmQJbCa2ONzJ8AGX1oTeHwXGz9ZPVstenci4o8lhwu1Jzim1UryW/XaPcYFH6wKm\nKwRAKJvn8awEvW4fzwD5fwI3u7cu19niT+KQAvDjV3HFuqnqu7LETCkr36hy30Hm\nIwIDAQAB\n-----END PUBLIC KEY-----\n" + finance: + url: finance.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxvRR2ay3HNjq/5rcGlBc\n2nFbQwCQK4nR/GqOUFAwdgWEIivwMALYWPQsNuU90RJqm0HkwxvdLXy/XRZfLSVC\nA5D3JtGmpstJKK7A1jOkP5sj54zs8NMnm2zrm9/YDrUmxUr58OOmsCIjiDXQ0PW+\nIR34FOde6yXgwriPUq2DjTo2UgujNPoNeICGmtTTV+YzVdOZmNqfRVnCpfUUnMsN\nDxzL8K2VzGa7KGJeCe5NEwCdJZ8FApMKUJORpCao9jR62dhZ0GKQpMqvO3c/aHxI\nWY+wnuzMWAZl96hIQc4ksnl7hcd2y5WSQZZS7OBdeSxumqJBqgCd6ITBhrzC5gSv\nCQIDAQAB\n-----END PUBLIC KEY-----\n" + ib: + url: ib.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzfoOcLyW3q7bYXArXEBC\nl62pLW7Yg0zyj5blWjU/DnIwxX6B8q48HfubDWQRGgHJsxCsGVrPwhUNEcmfS20q\nUlTBhx4Qt6qHXQYX0jBZbNg7fr2rbwNlbYovMUxF28dcik8K+eKz0fP2NH1lV4BS\ngDb9Nd/gNXozO67/MSrTCXXBKx8andlmVxhJSC8zQcQ4WXPpDhmTB0AvqUcRm/z7\nbLeIntibt6ke3/BVeixgu1Cf4u1y01+EsJ1sAnJzD+cSrq2tu5ccstbRfY5crY3v\n9YFQ3M9LrYV0fi91LhNt6xPNEvvQuZ21/Wwd9DL4D/7Hg55upcolfTxB3J83cTDg\niwIDAQAB\n-----END PUBLIC KEY-----\n" + im: + url: im.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy1o15uvdBKra9LQsjnRL\nyaJ2ZTOLlaS0ICu/RkDWNTz4gbwKhAvxvS2Om9O85MiZKaOtS+TgrMePk/zTztZA\nnxrVcVZStzj5//zKuOLAg2DOUH0Bd/uBTjvOkfc6CQrJuu50B1S+GgN08KeZSxw4\nYgKn6I3Dnm8NZfl9foZRnGgpgJSUrv2oN2RWTBqkwey9LbWtZ0yoRdZHZpVDKq50\n4PpqgAibNXy4er06yd9qqWA0wIoPPQIsYhBkDmqkBe+AxTV4hqX8W/M+j3ftA+T9\nsKAhMYJD/sWvXA1LbKwiYn2f2GNo6zECCPdbYVwbwVeRHslt6lL11ZejW7jaXVaA\nAwIDAQAB\n-----END PUBLIC KEY-----\n" + emba: + url: emba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzky+srC6d21nBP54Xtv+\nC6VJgjRolToLaaJKR6+qXW6lTU6/kYexfMiVTahcBtSooCDj137L/qn4NJpl/2UF\nXrx45n7FWWrXWJhlec6bh4Lg+wGcJrSDGF3GXhLD6T/0o++ep51zt5a6R3LW+WCg\nAUYzc6lWqSpKF/5Z3GfI4/jvNqrZLEoRtTR19WCjdO5J819XxUv3fW7TDx+XJ3kK\n9OsZWT81R7oushb2HFnGj0HJjwm5yCTFdWTzk6X/R0dAmg8lLcSDpeH1aq0YO/RB\nWycZEgIuV42eTaEg9aYbVnS7F2y8gIQjoVjlJF3VCsntzsaFpAEgXysla826Pna+\njQIDAQAB\n-----END PUBLIC KEY-----\n" + ntugmba: + url: ntugmba.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs4WtrGLgj2FEZx+NnHzb\nK1HJ+V3qCJ7jIFH7mboeAjEPrAMLeFIdV4MvoasPALxuoo34oZl1NK6vYnfic5xk\nhV956QIzhB3vd4KDu1zbuYQO3ojlBSP3mbJPyHT6fKSkjLjKy0R5HEeT1+yLizC1\nMCPVBiP7mpaYIKPwfmMXFLA8GQxwBO2VpWpQD7jzd/+UWEXjKoK5t2uoMDL0k0w0\naffMcZKNntENXTRgnTq4iK39ayT95iXw81FH+LyEo5XtiHYsO2mhOPc9j5tU3GCO\nKwFmXPlh2+B1YwV+lkfCqpdT37Z3lLNFmw7sYidMvD3xIiFBsPKspoa1qlURmnuH\nvQIDAQAB\n-----END PUBLIC KEY-----\n" + ia: + url: ia.management.ntu.edu.tw + key: "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvlVvwFF+k6/UI9+hhTEi\n032nTnEG/8l3ARfpSsTPwijsyk+e8Utjq3sslHVGlWzmT74KYHoMwNDYXiAH2wpS\n4k+vUugOPYNkY46smDG5oCGVVbmCORzzpZsccpXhFGft378NhNiTRNhk4DBMrFwb\nlALdd9sUDbqcc+PBJIW3KXD66+rcyImHpkEaa8t0rkAd1ZIkfLbXyQWikvOMWYvJ\n3K2+N/vVInAbVOmBwZgK0iP7ZvwvwR/li0nAkdD12jgvgrR6gP2pC+qyH15J2zib\nEz8aLweNBYq/BXGxtWxioFHif22v9LUj1fkAFqEoTwVCIGDdXn2/R9febBkSSPuL\ngQIDAQAB\n-----END PUBLIC KEY-----\n" From b55d3d94753b0073b6e60688999db7703d2db331 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 27 Sep 2013 14:33:19 +0800 Subject: [PATCH 6/8] Updated order for zh_tw translation --- .../member/front_end/member_lists/_show_office_field.html.erb | 2 +- .../member/front_end/member_lists/_show_research_field.html.erb | 2 +- .../panel/member/front_end/member_lists/_show_roles.html.erb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_office_field.html.erb b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_office_field.html.erb index ec26550a9..bd70d5c0e 100644 --- a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_office_field.html.erb +++ b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_office_field.html.erb @@ -14,7 +14,7 @@ %> - <% if rf.title == "Office"%> + <% if (rf.title == "Office" || rf.title == "研究室")%> <%= rf.title %> <%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %> diff --git a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_research_field.html.erb b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_research_field.html.erb index 364ea1463..bc93c7524 100644 --- a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_research_field.html.erb +++ b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_research_field.html.erb @@ -14,7 +14,7 @@ %> - <% if rf.title == "Research Field"%> + <% if (rf.title == "Research Field"|| rf.title == "研究領域")%> <%= rf.title %> <%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %> diff --git a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_roles.html.erb b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_roles.html.erb index 710e22a86..7fee0d91d 100644 --- a/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_roles.html.erb +++ b/vendor/built_in_modules/member/app/views/panel/member/front_end/member_lists/_show_roles.html.erb @@ -38,7 +38,7 @@ %> - <% if (rf.title != "Research Field" && rf.title != "Office")%> + <% if (rf.title == "Academic Position" || rf.title == "職稱")%> <%= rf.title %> <%= nl2br(show_attribute_value(@member.get_attribute_value(rf).get_value_by_locale(I18n.locale))) rescue '' %> From c457735c2f728c5ed54575422a355cbf0744a124 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 27 Sep 2013 15:09:18 +0800 Subject: [PATCH 7/8] Updated file name in writing conferences front end --- .../writing_conferences_controller.rb | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/front_end/writing_conferences_controller.rb diff --git a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/front_end/writing_conferences_controller.rb b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/front_end/writing_conferences_controller.rb new file mode 100644 index 000000000..cc41fc030 --- /dev/null +++ b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/front_end/writing_conferences_controller.rb @@ -0,0 +1,26 @@ +class Panel::PersonalConference::FrontEnd::WritingConferencesController < OrbitWidgetController + + def initialize + super + @app_title = 'personal_conference' + end + + + def index + + @writing_conferences = WritingConference.desc(:year).page(params[:page]).per(10) + + end + + # GET /writing_conferences/1 + # GET /writing_conferences/1.xml + def show + @writing_conference = WritingConference.find(params[:id]) + + @conference_paper_types = ( !@writing_conference.conference_paper_types.blank? ? @writing_conference.conference_paper_types.collect{|x| x.title}.join(', ') : nil) + @conference_author_types = ( !@writing_conference.conference_author_types.blank? ? @writing_conference.conference_author_types.collect{|x| x.title}.join(', ') : nil) + + end + + +end From 3825ab026425d05e3079ea2bd94cc797b9595264 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 27 Sep 2013 15:12:30 +0800 Subject: [PATCH 8/8] Updated filename of writing seminars to writing conferences --- .../front_end/writing_seminars_controller.rb | 26 ------------------- 1 file changed, 26 deletions(-) delete mode 100644 vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/front_end/writing_seminars_controller.rb diff --git a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/front_end/writing_seminars_controller.rb b/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/front_end/writing_seminars_controller.rb deleted file mode 100644 index cc41fc030..000000000 --- a/vendor/built_in_modules/personal_conference/app/controllers/panel/personal_conference/front_end/writing_seminars_controller.rb +++ /dev/null @@ -1,26 +0,0 @@ -class Panel::PersonalConference::FrontEnd::WritingConferencesController < OrbitWidgetController - - def initialize - super - @app_title = 'personal_conference' - end - - - def index - - @writing_conferences = WritingConference.desc(:year).page(params[:page]).per(10) - - end - - # GET /writing_conferences/1 - # GET /writing_conferences/1.xml - def show - @writing_conference = WritingConference.find(params[:id]) - - @conference_paper_types = ( !@writing_conference.conference_paper_types.blank? ? @writing_conference.conference_paper_types.collect{|x| x.title}.join(', ') : nil) - @conference_author_types = ( !@writing_conference.conference_author_types.blank? ? @writing_conference.conference_author_types.collect{|x| x.title}.join(', ') : nil) - - end - - -end