########################################################################

<?
    include '../include/sun_define.inc';  //PROF_DATA_2_DIR


    include_once "../include/function__perm.inc";
   
    $dir = PROF_SESS_DIR; //session 이 등록될 디렉토리임.
        $perm = get_Permission($dir);
        if( $perm == 777 || $perm == 707 || $perm == 757 ){
            session_save_path($dir);
            session_cache_limiter('nocache, must_revalidate');
        }else{
            echo "<p>세션 디렉토리 chmod 를 변경하시오.  ".
                    "<br>$dir  : 현재는 $perm ";
            exit;
        }

        /**
        session_start();
        $gl_sessId = session_id();
        $file = $dir. '/'. 'sess_'. $gl_sessId;
        chmod($file, 0644);
        **/


    #echo $dir. "<hr>";
    #echo $file;
 

    #echo '$gl_sessId='. $gl_sessId. '<br><p>';

?>

########################################################################

<?


/**
        $perm = $this->get_Permission();
        if( $perm == 777 || $perm == 707 || $perm == 757 ){
        }else{
            $msg = '<b>'. $this->UP_DIR. '</b> - Permission 을 조정하시오. 현재의 퍼미션은 '. $perm . '입니다.';
            $this->Error($msg);
            return false;
        }


**/

function get_Permission($file_dir){
    //return : 755, 644
    $f = $file_dir;
    if( ! $f ){
        return false;
    }
    if( ! file_exists($f)){
        echo "<br>[$f]는 존재하지 않습니다.<br>";
        exit;
    }
    $n = fileperms($f);
    $octal = sprintf("%o", $n);  ## 8진수로
        //$octal = base_convert($n, 10, 8); ## 8진수로
        //$octal = decoct($n);  ## 8진수로
    $perm = substr($octal, -3);  ## 755, 644

    return $perm;
}

?>

########################################################################

Posted by 알 수 없는 사용자
,