<?php F3::call(':ldap_login'); $cn = "*"; $data = myldap_search("cn={$cn}"); echo "<b>cn={$cn} icin arama sonuclari ...</b> <br />"; for ($i = 0; $i < $data["count"]; $i++) { $cn = $data[$i]["cn"]; $sn = $data[$i]["sn"]; $telephonenumber = $data[$i]["telephonenumber"]; $postalcode = $data[$i]["postalcode"]; $userpassword = $data[$i]["userpassword"]; echo "CN = {$cn}, SN = {$sn}, TelephoneNumber = {$telephonenumber}, PostalCode = {$postalcode}, PASS = {$userpassword}"; echo "<br />"; } //ldap_close(F3::get('LDAP.conn')); ?>
if ($hata = denetle($value, array('dolu' => array(true, "{$ne} boş bırakılamaz"), 'esit' => array(11, "{$ne} 11 haneli olmalıdır"), 'tamsayi' => array(true, "{$ne} sadece rakam içermeli"), 'ozel' => array(function ($value) { return !is_tc($value); }, "Geçerli bir {$ne} değil")))) { F3::set('error', $hata); return; } }); F3::input($alan = 'kizliksoyad', function ($value) use($alan) { $ne = "Kızlık Soyadı"; if ($hata = denetle($value, array('dolu' => array(true, "{$ne} boş bırakılamaz")))) { F3::set('error', $hata); return; } }); if (!F3::exists('error')) { $tc = F3::get('REQUEST.tc'); $kizliksoyad = F3::get('REQUEST.kizliksoyad'); $kul = new Axon('kul'); $kul->load("tc={$tc}"); if (!$kul->dry() && streq_turkish($kul->kizliksoyad, $kizliksoyad)) { // tc no'yu oturuma gömelim ve oradan alalım F3::set('SESSION.sorgutc', $tc); F3::set('SESSION.sorgukizliksoyad', $kizliksoyad); return F3::call(':sorguok'); } F3::set('error', "Girdiğiniz bilgilere uygun bir kayıt bulunamadı. Lütfen verdiğiniz bilgileri kontrol edin."); } // hata var, dön başa ve tekrar sorgu al. // error alanı dolu ve layout.htm'de görüntülenecek F3::call(':sorgual');
<?php // Retrieve blog entries $kul = new Axon('kul'); F3::set('entries', $kul->find()); // Use the home.htm template F3::set('pagetitle', 'ana sayfa'); F3::set('template', 'home'); F3::call('render');
<?php F3::call(":ldap_search"); $cn = "mahmut"; $cn_new = "murat"; echo "<hr /><b>cn = {$cn} kullanicisi \"{$cn_new}\" ile rename ediliyor ...</b><br />"; $r = @ldap_rename(F3::get('LDAP.conn'), "cn={$cn}," . F3::get('LDAP.ou'), "cn={$cn_new}", NULL, TRUE); echo $r ? "Basarili" : "UYARI: boyle bir kayit bulunamadi"; echo "<hr />Dizinlerin guncel hali...<br />"; F3::call(":ldap_search"); ldap_close(F3::get('LDAP.conn'));
<?php // Reset previous error message, if any F3::clear('message'); // Form field validation F3::call(':common'); if (!F3::exists('message')) { // No input errors; add record to database $blog = new Axon('kul'); $blog->copyFrom('REQUEST'); $blog->save(); // Return to home page; new blog entry should now be there F3::reroute('/'); /*$payload = json_encode(array(F3::get('REQUEST.title'), F3::get('REQUEST.entry'))); F3::reroute('http://192.168.140.86/receiver.php?payload=' . $payload );*/ } // Display the blog form again F3::call(':createkul');
<?php // Reset previous error message, if any F3::clear('message'); // Form field validation F3::call(':common'); if (!F3::exists('message')) { F3::call(':ldap_login'); $data = F3::get('REQUEST'); $cn = $data["cn"]; $data = f34data($data); $r = @ldap_modify(F3::get('LDAP.conn'), "cn={$cn}," . F3::get('LDAP.ou'), $data); F3::reroute('/'); } // Display the blog form again F3::call(':editkul');
<?php require __DIR__ . '/lib/base.php'; #F3::set('CACHE',TRUE); F3::set('DEBUG', 1); F3::set('UI', 'ui/'); F3::set('IMPORTS', 'imports/'); F3::set('FACEBOOK.client_id', '***REMOVED***'); F3::set('FACEBOOK.client_secret', '***REMOVED***'); F3::set('FACEBOOK.redirect_uri', 'http://singleyet.com/login/'); F3::set('FACEBOOK.session_key', F3::resolve('fb_{{@FACEBOOK.client_id}}_access_token')); F3::set('DB', new DB('mysql:host=localhost;port=3306;dbname=singleyet', 'singleyet', '***REMOVED***')); F3::call('facebook/facebook.php'); F3::set('Facebook', new Facebook(array('appId' => F3::get('FACEBOOK.client_id'), 'secret' => F3::get('FACEBOOK.client_secret')))); ///////////////////////////////////////////////// // Status Codes // ///////////////////////////////////////////////// # 1 = Single # 2 = In a relationship # 3 = Engaged # 4 = Married # 5 = It's complicated # 6 = In an open relationship # 7 = Widowed # 8 = Separated # 9 = Divorced # 10 = In a civil union # 11 = In a domestic relationship # 12 = Not set ///////////////////////////////////////////////// # Single = 1, 5, 6, 7, 8, 9, 12 //
<?php // Execute validation rules F3::call('cn|sn|telephonenumber|postalcode|userpassword'); /** Functions below are used by both saveblog.php and updateblog.php import files for validation of form fields in the blog entry page **/ function cn() { // Validate cn F3::input('cn', function ($value) { if (!F3::exists('message')) { if (empty($value)) { F3::set('message', 'Ad should not be blank'); } elseif (strlen($value) > 127) { F3::set('message', 'Ad is too long'); } elseif (strlen($value) < 3) { F3::set('message', 'Ad is too short'); } } // Do post-processing of cn here F3::set('REQUEST.cn', ucfirst($value)); }); } function sn() { // Validate sn F3::input('sn', function ($value) { if (!F3::exists('message')) { if (empty($value)) {
<?php // Execute validation rules F3::call('tc|ad|soyad'); /** Functions below are used by both saveblog.php and updateblog.php import files for validation of form fields in the blog entry page **/ function tc() { // Validate tc F3::input('tc', function ($value) { if (!F3::exists('message')) { if (empty($value)) { F3::set('message', 'TC should not be blank'); } elseif (strlen($value) > 127) { F3::set('message', 'TC is too long'); } elseif (strlen($value) < 3) { F3::set('message', 'TC is too short'); } } // Do post-processing of tc here F3::set('REQUEST.tc', ucfirst($value)); }); } function ad() { // Validate blog ad F3::input('ad', function ($value) { if (!F3::exists('message')) { if (empty($value)) {
F3::clear('message'); // Form field validation F3::call('checkID|password|captcha'); if (!F3::exists('message')) { // No input error; check values if (preg_match('/^admin$/i', F3::get('REQUEST.userID')) && preg_match('/^admin$/i', F3::get('REQUEST.password'))) { // User ID is admin, password is admin - set session variable F3::set('SESSION.user', '{@REQUEST.userID}'); // Return to home page; but now user is logged in F3::reroute('/'); } else { F3::set('message', 'Invalid user ID or password'); } } // Display the login page again F3::call(':login'); /** Functions below are used by this sandboxed import file for validation of form fields in the login page **/ function checkID() { // Validate user ID F3::input('userID', function ($value) { if (!F3::exists('message')) { if (empty($value)) { F3::set('message', 'User ID should not be blank'); } elseif (strlen($value) > 24) { F3::set('message', 'User ID is too long'); } elseif (strlen($value) < 3) { F3::set('message', 'User ID is too short');
require_once 'lib/F3.php'; F3::set('RELEASE', FALSE); // Use custom 404 page F3::set('E404', 'layout.htm'); // Path to our Fat-Free import files F3::set('IMPORTS', 'inc/'); // Path to our CAPTCHA font file F3::set('FONTS', 'fonts/'); // Path to our templates F3::set('GUI', 'gui/'); // Another way of assigning values to framework variables F3::set('site', 'Kullanıcı Veritabanı'); // Common inline Javascript F3::set('extlink', 'window.open(this.href); return false;'); F3::set('DB', array('dsn' => 'mysql:host=localhost;port=3306;dbname=f3', 'user' => 'f3', 'password' => 'secret')); F3::call(':db'); // Define our main menu; this appears in all our pages F3::set('menu', array_merge(array('Ana sayfa' => '/'), F3::get('SESSION.user') ? array('Kaydı Güncelle' => '/update', 'Hakkında' => '/about', 'Çıkış' => '/logout') : array('Yeni Kayıt' => '/new', 'Kaydı Güncelle' => '/login'))); F3::route('GET /', ':home'); // Minify CSS; and cache page for 60 minutes F3::route('GET /min', ':minified', 3600); F3::route('GET /about', ':about', 3600); // This is where we display the login page F3::route('GET /login', ':login', 3600); // This route is called when user submits login credentials F3::route('POST /login', ':auth'); // New blog entry F3::route('GET /new', ':createkul'); // Submission of blog entry F3::route('POST /new', ':savekul'); F3::route('GET /show', ':showkul');
$kul = new Axon('kul'); $kul->copyFrom('REQUEST'); $kul->tarih = date("d-m-Y H:i"); // artık elimizde temiz bir tc no var, resmi kaydedelim // ilk kurulum sırasında bu <uploaddir> dizinini oluştur // php prosesi yazacağına göre izinleri doğru ayarla // chgrp -R www-data <uploaddir> && chmod g+w <uploaddir> $tc = $kul->tc; F3::set('tc', $tc); if (!empty($tc)) { $resim = F3::get('uploaddir') . $kul->tc . '.jpg'; yukle($resim); } if (!F3::exists('error')) { // here we go! $kul->save(); // TODO: burada bir özet verelim F3::set('message', 'Kaydınız başarıyla yapıldı.'); // tc no'yu oturuma gömelim ve oradan alalım F3::set('SESSION.tc', $tc); return F3::call(':ok'); } else { if (file_exists($yeni) && !unlink($yeni)) { // TODO ne yazayım ben şimdi buraya } } } // hata var, dön başa ve tekrar kayıt al. // error alanı dolu ve layout.htm'de görüntülenecek F3::call(':goster');