RigPi Login Code

<< Click to Display Table of Contents >>

Navigation:  Technical >

RigPi Login Code

RigPi requires a unique username for each account.  Passwords are optional, but are recommended if you wish to use RigPi through the Internet.  The diagram below shows the logic flow as you log in.  

 

     +-----------------------+

     |  User enters                |

     |  username/password |

     +-----------+----------+

                        |

                        v

 +----------------- --------------+

 | Membership->check_user()   |

 +-------------------------------+

                     |

                     v

     [ Validate user input ]

                     |

                     v

 +----------------------------+

 | Connect to MySQL 'Users'  |

 | via MysqliDb                      |

 +----------------------------+

                     |

                     v

 [ Check for username match ]

                 |

    +-------+-------+

    |                          |

    v                         v

[ Found ]        [ Not Found ]

    |                         |

    v                        v

[ Check system     Return "NG"

 startup time ]

    |

    v

[ Call User->validate_user() ]

    |

    v

[ Capture client IP address ]

               |

               v

 [ Credentials OK? ]

                   |

    +---------------------+

    |                                  |

   Yes                           No

    |                                 |

    v                                v

[ Load Access_Level,      Log failed

 MyCall info ]                 attempt,

                                      return "NG"

         |

         v

[ Update 'Users' table

 (LastVisit, Active=1) ]

         |

         v

[ Add new record in

 'LoggedIn' table ]

            |

            v

[ Set session variables ]

            |

            v

[ Write success to rigpi-access.log ]

                    |

                    v

[ Redirect:

 ADMIN → wizardUser.php

 Level>9 → ptt_only.php

 All others → index.php ]