2023-01-05 17:53:12 +01:00
include CrystalGauntlet
CrystalGauntlet . template_endpoints [ " / #{ config_get ( " general.append_path " ) . as ( String | Nil ) || " " } accounts/accountManagement.php " ] = - > ( context : HTTP :: Server :: Context ) {
context . response . headers . add ( " Location " , " /accounts/ " )
context . response . status = HTTP :: Status :: MOVED_PERMANENTLY
}
CrystalGauntlet . template_endpoints [ " /accounts " ] = - > ( context : HTTP :: Server :: Context ) {
context . response . content_type = " text/html "
2023-01-10 16:32:12 +01:00
2023-01-11 14:51:14 +01:00
user_id = nil
username = nil
Templates . auth ( )
2023-01-10 16:32:12 +01:00
2023-01-11 14:51:14 +01:00
stars , demons , coins , user_coins , diamonds , creator_points = DATABASE . query_one ( " select stars, demons, coins, user_coins, diamonds, creator_points from users where id = ? " , user_id , as : { Int32 , Int32 , Int32 , Int32 , Int32 , Int32 } )
2023-01-10 16:32:12 +01:00
2023-01-11 14:51:14 +01:00
ECR . embed ( " ./public/template/account_management.ecr " , context . response )
2023-01-05 17:53:12 +01:00
}