Jump to content
Toggle menu
  • 6 users
  • 271 edits
The Commonwealth of Acropolis
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

The Constitution is blocked from ratification due to the standing appointment of the Recruiter-General

Away:Module-get: Difference between revisions

From The Commonwealth of Acropolis
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
         ;;
         ;;
     dob) # user_name -> date_of_birth
     dob) # user_name -> date_of_birth
         mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT date_of_birth FROM user WHERE user_name = '$2';"
         mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT date_of_birth FROM user WHERE user_name = '$2';" | tail -n1
         ;;
         ;;
     gender) # user_name -> gender_marker
     gender) # user_name -> gender_marker
         mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT gender_marker FROM user WHERE user_name = '$2';"
         mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT gender_marker FROM user WHERE user_name = '$2';"
        ;;
    id) # user_name -> user_id
        mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT user_id FROM user WHERE user_name = '$2';"
        ;;
esac
esac

Latest revision as of 13:43, 30 September 2026

#!/usr/bin/env bash

case $1 in
    name) # user_name -> user_real_name
        mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT user_real_name FROM user WHERE user_name = '$2';"
        ;;
    dob) # user_name -> date_of_birth
        mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT date_of_birth FROM user WHERE user_name = '$2';" | tail -n1
        ;;
    gender) # user_name -> gender_marker
        mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT gender_marker FROM user WHERE user_name = '$2';"
        ;;
    id) # user_name -> user_id
        mariadb --password="${wgDBpassword}" "${wgDBname}" <<<"SELECT user_id FROM user WHERE user_name = '$2';"
        ;;
esac