[精讚] [會員登入]
1092

更新IDP程式以新增及修正本地管理帳號登入

add locallogin page and function with local authorized account

分享此文連結 //n.sfs.tw/12927

分享連結 更新IDP程式以新增及修正本地管理帳號登入@外行中的外行
(文章歡迎轉載,務必尊重版權註明連結來源)
2019-04-11 10:51:01 最後編修
2018-11-22 23:56:56 By jung
 

為了達到各縣市管理者自行新增首頁連結,做到類似入口網的功能,及自訂頁面content、footer等內容,需做下列修改

1.cncauthserver、CncResource、縣市xxauth 更新函式庫cnclibs 0.0.8.4 EduDataType 0.2.3.9

2.合併(merge)tc-idp程式

如果使用netbeans,在專案上按右鍵,Git功能->Branch/Tag->Merge Revision

再選擇要合併的分支

 

3.到mongo增加管理者帳號

db.systemstore.update({"_id":ObjectId("5ae0b3c4f0382232e0xxxxd7")},{$push:{"manager":"neaoOOXX"}})
//manager欄位增加管理者帳號"neaoOOXX"
//ObjectId必須與mongo裡的相同

systemadmin也是增加管理帳號,指令同上,但目前manager無任何權限(無法修改頁面文字或新增應用服務)只能看到管理選單

4.接下來還有一個問題,因為當初開發frontendpagetype時,在json檔(放置預設內容用)多寫了一個欄位pagetype但指向的資料內容相同,導致每次在前端編輯頁面內容儲存後仍然失效,因為程式指到另一個pageType欄位了

因此要先做下列動作

4-1 

 db.frontendpagetype.find({},{"pagetype":1})

把所有重複但名稱只差一個字母大寫造成的欄位列出

像上圖多餘的數值(有二個HOME),對照ObjectId再用remove刪除

db.frontendpagetype.remove({"_id":ObjectId("5aba618bXXXe69403988057")})

4-2

db.frontendpagetype.update({"_id":ObjectId("5aba618bXXXe69403988057")},{$set:{"pageType":"QA"}})

列出之後照ObjectId把五個pagetype改成pageType

完成,就可以到xx.sso.edu.tw使用設定好的管理帳號登入修改頁面呈現的文字內容了

如果不小心打錯可用$unset把有錯的欄位刪除

例如: db.frontendpagetype.update({"_id":ObjectId("5aba62128561e693988059")},{$unset:{"pageType":"PRIVACY"}})

注意!! 更新函式庫後,管理頁面的新功能需使用mongo資料庫,在mongo中必須建立portalstore這個表

db.createCollection("portalstore")

在縣市idp的程式xxauth下sysconfigs.properties內加入新的一行

mongo.collection.portalstore=portalstore

才能正確使用新增網站連結的功能

END

你可能感興趣的文章

更新程式環境到wildfly18+openjdk11-phase3: 伺服器環境升級準備 upgrade jdk and wildfly on server

[java]縣市IDP建置 使用NetBeans建置IDP程式

縣市端IdP新增自訂首頁內容功能 合併本部主程式,手動於mongo內新增管理使用者資料

縣市IDP更換SSL憑證及修改servername+wildfly等設定 縣市IDP更換SSL

新增IDP程式使用google防機器人的驗證功能 身份認證程式新增google防機器人v2

solution for selinux issue while installing zabbix agent on centos7 install zabbix agent as service will raise selinux issue on some centos 7.3.1611

隨機好文

如何在ubuntu 18.04上設定一開機就啟動virtualbox某個vm a way to setup ubuntu18.04 for start vm on boot

ubuntu18.04網路設定無法啟動問題 network connection failed due to networkmanager settings

zfs on ubuntu 20.04 how to destroy zfs pool while error message said pool is busy

determine strings that include numbers and spaces differ from Highest and Lowest numbers inside strings that includes spaces

macbook pro 2019翻蓋就開機問題 macbook automatically boot itself while lifting screen up