mango r178 - in trunk: lib www



Author: ovitters
Date: Sun Jun  1 00:13:26 2008
New Revision: 178
URL: http://svn.gnome.org/viewvc/mango?rev=178&view=rev

Log:
Various code fixes.


Modified:
   trunk/lib/user.php
   trunk/www/update_user.php

Modified: trunk/lib/user.php
==============================================================================
--- trunk/lib/user.php	(original)
+++ trunk/lib/user.php	Sun Jun  1 00:13:26 2008
@@ -259,7 +259,7 @@
         if(PEAR::isError($result)) return $result;
 
         $newkeys = array_diff($this->authorizedKeys, $olduser->authorizedKeys);
-        $result = $this->_update_sshkey($ldap, $dn, $olduser, $user, true, $newkeys, $changes, 'key-add', 'keysadded');
+        $result = $this->_update_sshkey($ldap, $dn, $olduser, true, $newkeys, $changes, 'key-add', 'keysadded');
         if(PEAR::isError($result)) return $result;
 
 
@@ -298,7 +298,7 @@
         return $changes;
     }
 
-    function _update_sshkey($ldap, $dn, $olduser, $user, $is_add, $keys, &$changes, $desc_key, $desc_change) {
+    function _update_sshkey($ldap, $dn, $olduser, $is_add, $keys, &$changes, $desc_key, $desc_change) {
         if(!is_array($keys) || count($keys) == 0)
             return false;
 
@@ -422,7 +422,7 @@
     }
 
     function _has_shell() {
-        return $user->homeDirectory !== '/';
+        return $this->homeDirectory !== '/';
     }
 
     function _should_have_shell() {

Modified: trunk/www/update_user.php
==============================================================================
--- trunk/www/update_user.php	(original)
+++ trunk/www/update_user.php	Sun Jun  1 00:13:26 2008
@@ -188,10 +188,11 @@
         $prevkeys = array_unique($this->user->authorizedKeys);
 
         $this->user->authorizedKeys = array();
+        $newkeys = "";
         if($_FILES['keyfile']['tmp_name']) {
-            $keyfile = file_get_contents($_FILES['keyfile']['tmp_name']);
+            $newkeys .= file_get_contents($_FILES['keyfile']['tmp_name']);
         }
-        $newkeylist = $keyfile."\n".$_POST['newkeys'];
+        $newkeys .= "\n".$_POST['newkeys'];
         $newkeys = split("\n", $newkeylist);
         foreach($newkeys as $key) {
             if(empty($key) || substr($key, 0, 3) != "ssh") continue;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]