IanTDuncan / MealTime

Project for CSC 480
0 stars 0 forks source link

Removal of Login and Registration Page - Backend Development #161

Closed Cade5480 closed 3 months ago

Cade5480 commented 3 months ago

Removal of Login page and Registration Page


Description:

Removing login and registration page.

Steps to Reproduce:

N/A

Expected vs. Actual Behavior:

That there will be no prompt for login or anything

Code Snippets:

`//        val SQLiteOpenHelper = DatabaseHelper(this)
//
//        editTextUsername = findViewById(R.id.editTextUsername)
//        editTextPassword = findViewById(R.id.editTextPassword)
//        buttonLogin = findViewById(R.id.buttonLogin)
//        buttonRegisterPage = findViewById(R.id.buttonRegisterPage)
//
//        buttonRegisterPage.setOnClickListener {
//            // Navigate to RegistrationActivity
//            val intent = Intent(this, RegistrationActivity::class.java)
//            startActivity(intent)
//        }
//
//
//        buttonLogin.setOnClickListener {
//            // This is the beginning of our login logic, simple checking.
//            val username = editTextUsername.text.toString()
//            val password = editTextPassword.text.toString()
//
//            // Example: Check if username and password are not empty
//            if (username.isNotEmpty() && password.isNotEmpty()) {
//                // The below stuff is a placeholder for what we actually do when a login is unsuccessful.
//                Toast.makeText(this, "Login successful", Toast.LENGTH_SHORT).show()
//                val intent = Intent(this, MainMenuActivity::class.java)
//                startActivity(intent)
//            } else {
//                Toast.makeText(this, "Please enter username and password", Toast.LENGTH_SHORT)
//                    .show()
//            }

//            buttonLogin.setOnClickListener {
//                // This is the beginning of our login logic, simple checking.
//                val username = editTextUsername.text.toString()
//                val password = editTextPassword.text.toString()
//
//                // Example: Check if username and password are not empty
//                if (username.isNotEmpty() && password.isNotEmpty()) {
//                    // Open the database for reading
//                    val db = SQLiteOpenHelper.readableDatabase
//
//                    // Query the database to check if the provided username and password match
//                    val selection = "username = ? AND password = ?"
//                    val selectionArgs = arrayOf(username, password)
//                    val cursor = db.query("User", null, selection, selectionArgs, null, null, null)
//
//                    if (cursor.moveToFirst()) {
//                        // Username and password match, login successful
//                        Toast.makeText(this, "Login successful", Toast.LENGTH_SHORT).show()
//                        val intent = Intent(this, MainMenuActivity::class.java)
//                        startActivity(intent)
//                    } else {
//                        // Username and password do not match, login unsuccessful
//                        Toast.makeText(this, "Invalid username or password", Toast.LENGTH_SHORT).show()
//                    }
//
//                    // Close the cursor and database connections when done
//                    cursor.close()
//                    db.close()
//                } else {
//                    Toast.makeText(this, "Please enter username and password", Toast.LENGTH_SHORT).show()
//                }
//            }`

Environment Details:

Android Studio IDE

For Issue Resolution:

N/A

For Investigations/Research:

N/A

Current Status:

Done

Cade5480 commented 3 months ago

all login and registration code has been removed