Add channels ACP interface

This commit is contained in:
calzoneman 2014-02-05 17:44:37 -06:00
parent bde57973c3
commit 0998e89f5d
4 changed files with 173 additions and 6 deletions

View file

@ -175,6 +175,25 @@ module.exports = {
});
},
/**
* Searches for a channel by owner
*/
searchOwner: function (name, callback) {
if (typeof callback !== "function") {
return;
}
db.query("SELECT * FROM `channels` WHERE owner LIKE ?",
["%" + name + "%"],
function (err, rows) {
if (err) {
callback(err, null);
return;
}
callback(null, rows);
});
},
/**
* Validates and registers a new channel
*/
@ -266,7 +285,7 @@ module.exports = {
fs.unlink(path.join(__dirname, "..", "..", "chandump", name),
function (err) {
if (err) {
if (err && err.code !== "ENOENT") {
Logger.errlog.log("Deleting chandump failed:");
Logger.errlog.log(err);
}