#!/bin/sh

# turn on Legacy support
su -l apl -c '/opt/sarch/api/bin/call function=setIdentityAttributes attributes={\"LEGACY_SUPPORT\":\"yes\"}'

# turn off CSRF check
su -l apl -c '/opt/sarch/api/bin/call function=setIdentityAttributes attributes={\"CHECK_CSRFTOKEN\":\"no\"}'

# turn off WS security
su -l apl -c '/opt/sarch/api/bin/call function=setIdentityAttributes attributes={\"CHECK_WSSECURITY\":\"no\"}'

# Require account passwords to be changed after 10 years
su -l apl -c '/opt/sarch/api/bin/call function=setIdentityAttributes attributes={\"PASSWORD_EXPIRATION\":\"3650\"}'

# update password to sha1(topse)
su -l apl -c "/opt/sarch/db/bin/db_exec -a -c \"update password_history set password = '{\\\"sha512\\\":\\\"734c883fb55e212cfe7a48ba6e2a33ff2f7ed275be04aeff6ea228ee6a2ac885ac4dd962a7bafe3514cd0f7cda7163d467b5652e7e1de7fd74a1a12b74b2ee64\\\",\\\"sha1\\\":\\\"9cde3f9c7f7012d817a4a54f41ded3e151af6b66\\\"}' where userid = 21 and char_length(password) = 142;\" skm_local"
