* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with FusionForge; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
require dirname(__FILE__).'/../../env.inc.php';
$err='';
-$res=db_query_params ('SELECT user_name,user_id,authorized_keys
- FROM users
+$res=db_query_params ('SELECT user_name,user_id,authorized_keys
+ FROM users
WHERE authorized_keys != $1
AND status=$2 AND unix_status = $3',
array('',
$ssh_key=str_replace('###',"\n",$ssh_key);
$uid += 1000;
- $ssh_dir = "forge_get_config('homedir_prefix')/$username/.ssh";
+ $ssh_dir = forge_get_config('homedir_prefix')."/$username/.ssh";
if (!is_dir($ssh_dir)) {
mkdir ($ssh_dir, 0755);
}
posix_seteuid(0);
posix_setegid(0);
- system("chown $username:users forge_get_config('homedir_prefix')/$username");
+ system("chown $username:users ".forge_get_config('homedir_prefix')."/$username");
system("chown $username:users $ssh_dir");
system("chmod 0644 $ssh_dir/authorized_keys");
system("chown $username:users $ssh_dir/authorized_keys");