<?php
 class RestarterDB extends ADO { public function __construct( $app, $dburi, $debug=false, $tmode=true, $dformat='') { $this->owner = $app; if ( !empty($dburi)) $this->dburi = $dburi; return parent::__construct( $this->dburi, $debug, $tmode, $dformat); } public function get_flag() { $res = $this->GetAll("SELECT count(*) FROM sk_system_conf WHERE attribute='radiusd_restart'"); return ($res[0][0] > 0); } public function clean_flag() { return $this->Execute("DELETE FROM sk_system_conf WHERE attribute='radiusd_restart'"); } public function set_flag($id=0) { return $this->Execute("INSERT INTO sk_system_conf (attribute, value, provider_id) VALUES('radiusd_restart', '".$this->owner->hostname."', '".$id."')"); } } ?>
