Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
greenpreneurs /
api /
controllers /
[ HOME SHELL ]
Name
Size
Permission
Action
admin.dashboard.controller.js
12.23
KB
-rw-r--r--
auth.controller.js
5.83
KB
-rw-r--r--
blog.controller.js
5.49
KB
-rw-r--r--
event.controller.js
1.43
KB
-rw-r--r--
homePage.controller.js
1.33
KB
-rw-r--r--
individualBlog.controller.js
4.96
KB
-rw-r--r--
user.controller.js
4.33
KB
-rw-r--r--
user.dashboard.controller.js
6.88
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : user.controller.js
import pool from "../config/db.js"; // ✅ Test endpoint for checking controller functionality export const test = (req, res) => { res.json({ message: 'user controller is working!' }); }; // ✅ Register Entity export const registerEnt = async (req, res) => { const { CID, firstname, lastname, linkedinId, email, website, imageUrl, description } = req.body; console.log(req.body); console.log(CID, firstname, lastname, linkedinId, email, website, imageUrl, description); // Validation if (!CID || !firstname || !lastname || !linkedinId || !email || !website || !imageUrl || !description) { return res.status(400).json({ error: 'Please fill in all required fields' }); } const insertEntQuery = ` INSERT INTO verifiedEnt (FirstName, LastName, LinkedinProfileURL, Email, Website, ProfileImage, Description) VALUES (?, ?, ?, ?, ?, ?, ?) `; try { const result = await pool.query(insertEntQuery, [firstname, lastname, linkedinId, email, website, imageUrl, description]); const entId = result.insertId; // Get the generated id from verifiedEnt // Now insert into Verified_ENT_MAP_User table const insertMapQuery = ` INSERT INTO Verified_ENT_MAP_User (CID, id) VALUES (?, ?) `; await pool.query(insertMapQuery, [CID, entId]); return res.status(200).json({ message: 'Entity registered successfully', id: entId }); } catch (err) { console.error('Error during entity registration:', err); // Handle specific errors like duplicate entry for email or LinkedIn if (err.code === 'ER_DUP_ENTRY') { return res.status(409).json({ error: 'Email or LinkedIn profile already exists' }); } return res.status(500).json({ error: 'Database error' }); } }; // ✅ Get All Products with Pagination export const getAllProducts = async (req, res) => { try { const limit = parseInt(req.query.limit) || 10; // Default limit to 10 if not provided const offset = parseInt(req.query.offset) || 0; // Default offset to 0 if not provided const queryText = ` SELECT * FROM product_list LIMIT ${limit} OFFSET ${offset} `; const results = await pool.query(queryText); console.log("getAllProducts", results[0]); res.status(200).json({ data: results[0], }); } catch (error) { console.error("Error retrieving products:", error); return res.status(500).json({ success: false, message: "Error retrieving products", error: error.message, }); } }; // ✅ Get Resources with Pagination export const getResources = async (req, res) => { try { const limit = parseInt(req.query.limit) || 10; // Default limit to 10 if not provided const offset = parseInt(req.query.offset) || 0; // Default offset to 0 if not provided const queryText = ` SELECT * FROM Resources LIMIT ${limit} OFFSET ${offset} `; const results = await pool.query(queryText); res.status(200).json({ success: true, data: results[0], }); } catch (error) { console.error("Error retrieving resources:", error); return res.status(500).json({ success: false, message: "Error retrieving resources", error: error.message, }); } }; // ✅ Get Stories with Pagination export const getStories = async (req, res) => { try { const limit = parseInt(req.query.limit) || 10; // Default limit to 10 if not provided const offset = parseInt(req.query.offset) || 0; // Default offset to 0 if not provided const queryText = ` SELECT * FROM Stories LIMIT ${limit} OFFSET ${offset} `; const results = await pool.query(queryText); res.status(200).json({ success: true, data: results[0], }); } catch (error) { console.error("Error retrieving stories:", error); return res.status(500).json({ success: false, message: "Error retrieving stories", error: error.message, }); } };
Close