function dhUID() { if (dhIsLogin()) { return $_SESSION['dhUID']; } else { return false; } }
function dhMenu() { if (dhIsLogin()) { $menu = array(); $netmenu = array('label' => dhLang('Redes'), 'url' => 'networks', 'items' => array(array('label' => dhLang('Agregar'), 'url' => 'networks', 'params' => array('action' => 'add')))); $networks = dhNetworks(); foreach ($networks as $network) { $netmenu['items'][] = array('label' => $network['netname'], 'url' => 'networks', 'params' => array('n' => $network['id_networks'])); } $menu[] = $netmenu; $menu[] = array('label' => dhLang('Perfil'), 'url' => 'profile'); return $menu; } return array(); }
<?php $root = realpath(dirname(__FILE__)); include_once "{$root}/config.php"; include_once "{$root}/common.php"; if (dhIsLogin()) { dhRedirect('index'); } if (dhIsPost()) { $name = dhPost('name'); if (dhValid(array('name' => 'required'))) { die('die'); } } dhTheme('lostpassword');
<?php $root = realpath(dirname(__FILE__)); include_once "{$root}/config.php"; include_once "{$root}/common.php"; if (!dhIsLogin()) { dhRedirect('index'); } if (dhIsPost()) { if (dhValid(array('netname' => 'required'))) { $netname = dhPost('netname', 'WORKGROUP'); dhQueryInsert('networks', array('id_users' => dhUID(), 'netname' => $netname, 'created' => time())); if (dhConfig('useModRewrite')) { dhRedirect('networks'); } else { dhRedirect('networks', array('success' => urlencode($netname))); } } } dhTheme('networks-add');
<?php $root = realpath(dirname(__FILE__)); include_once "{$root}/config.php"; include_once "{$root}/common.php"; if (dhHasGet('name') && !dhIsLogin()) { dhTheme('register-success'); } else { dhRedirect('index'); }