// Shared · Account Settings — members edit their own profile. Used as the // "Account" tab in BOTH the student and admin/coach portals. // Exposes window.AccountSettings and window.cgDisplayName. // // LOCKED: registered name + email. They are identity of record, tied to // payments and account recovery; only the main admin can change a name. // // All writes go through update_my_profile() / update_my_coach_profile(). // There is deliberately NO RLS policy letting a member UPDATE their own row — // one would also expose tier, vip and status, and RLS cannot be scoped to a // single column. The RPCs write exactly the fields below and nothing else. // // birthdate lives in member_private, a table whose only policy is // "member reads own". Staff `select *` on students cannot reach it. (function(){ const { useState, useEffect } = React; function displayName(fullName, nickname){ const n=(nickname||'').trim(), f=(fullName||'').trim(); if(!n) return f; if(!f) return n; return f+' ('+n+')'; } window.cgDisplayName = displayName; // Zones our members actually live in, so nobody scrolls a 400-entry list. const ZONES = [ ['Asia/Manila','Philippines (PHT)'], ['Asia/Dubai','UAE (GST)'], ['Asia/Singapore','Singapore'], ['Asia/Hong_Kong','Hong Kong'], ['Asia/Tokyo','Japan'], ['Asia/Seoul','South Korea'], ['Asia/Qatar','Qatar'], ['Asia/Riyadh','Saudi Arabia'], ['Asia/Kuwait','Kuwait'], ['Asia/Almaty','Kazakhstan'], ['Europe/London','United Kingdom'], ['Europe/Rome','Italy'], ['Europe/Madrid','Spain'], ['Europe/Berlin','Germany'], ['America/Toronto','Canada (Eastern)'], ['America/Vancouver','Canada (Pacific)'], ['America/New_York','USA (Eastern)'], ['America/Los_Angeles','USA (Pacific)'], ['Australia/Sydney','Australia (Sydney)'], ['Pacific/Auckland','New Zealand'], ]; // 7:00 AM PH shown in the member's own zone — the whole point of storing it. function localEquivalent(tz){ if(!tz) return null; try{ const now = new Date(); const ph = new Date(now.toLocaleString('en-US',{timeZone:'Asia/Manila'})); const d = new Date(ph); d.setHours(7,0,0,0); const shift = d.getTime() - ph.getTime() + now.getTime(); return new Date(shift).toLocaleTimeString('en-US', {timeZone:tz, hour:'numeric', minute:'2-digit'}); }catch(e){ return null; } } const Row = ({label, hint, children}) =>
Keep your details current so your coach can reach you and your session times are right.
🔒 These are locked. They're tied to your membership record, payments and account recovery. If either is wrong, message the admin and they'll correct it for you.
Need to change your password? Log out and use Forgot password on the sign-in page — we'll email you a secure reset link.