当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_APP::getAppPath方法代码示例

本文整理汇总了PHP中OC_APP::getAppPath方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_APP::getAppPath方法的具体用法?PHP OC_APP::getAppPath怎么用?PHP OC_APP::getAppPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC_APP的用法示例。


在下文中一共展示了OC_APP::getAppPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkPassword

 public function checkPassword($uid, $password)
 {
     if (!$this->db_conn) {
         $this->connectdb();
     }
     if (!$this->db_conn) {
         return false;
     }
     $query = 'SELECT user_login, user_pass FROM ' . self::$params['wordpress_db_prefix'] . 'users WHERE user_login = "' . str_replace('"', '""', $uid) . '"';
     $query .= ' AND user_status = 0';
     $result = $this->wp_instance->db->query($query);
     if ($result && mysqli_num_rows($result) > 0) {
         $row = mysqli_fetch_assoc($result);
         $hash = $row['user_pass'];
         $normalize_path = str_replace('\\', '/', OC_APP::getAppPath('user_wordpress'));
         $path_array = explode('/', $normalize_path);
         array_pop($path_array);
         $app_folder = array_pop($path_array);
         OC::$CLASSPATH['OC_wordpress'] = $app_folder . '/lib/wordpress.class.php';
         require_once $app_folder . '/user_wordpress/class-phpass.php';
         $wp_hasher = new WPPasswordHash(8, TRUE);
         $check = $wp_hasher->CheckPassword($password, $hash);
         if ($check === true) {
             // Make sure the user is in the wordpress_global_group
             if (self::$params['wordpress_global_group'] != '') {
                 if (!OC_Group::groupExists(self::$params['wordpress_global_group'])) {
                     OC_Group::createGroup(self::$params['wordpress_global_group']);
                 }
                 $UserblogsIds = $this->wp_instance->getUserblogsIds($uid);
                 if (empty($UserblogsIds)) {
                     // remove from group if current user has no access to Wordpress blog/site with the same role name.
                     OC_Group::removefromGroup($uid, self::$params['wordpress_global_group']);
                 } else {
                     OC_Group::addToGroup($uid, self::$params['wordpress_global_group']);
                 }
             }
             $this->setUserInfos($uid);
             return $row['user_login'];
         }
     }
     return false;
 }
开发者ID:silvioheinze,项目名称:user_wordpress,代码行数:42,代码来源:user_wordpress.php

示例2: array

 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
// only need filesystem apps
//echo json_encode('WP is here !');
//
//echo $baseuri;
$RUNTIME_APPTYPES = array('filesystem', 'authentication', 'share');
//
OC_App::loadApps($RUNTIME_APPTYPES);
$normalize_path = str_replace('\\', '/', OC_APP::getAppPath('user_wordpress'));
$path_array = explode('/', $normalize_path);
array_pop($path_array);
$app_folder = array_pop($path_array);
require_once $app_folder . '/lib/autoauth.php';
//require_once('apps/user_wordpress/lib/autoauth.php');
if (isset($_REQUEST['share_link'])) {
    if (OC_App::isEnabled('files_sharing')) {
        $file_path = urldecode(substr(implode('/', array_slice($vars, 5)), 0, -11));
        $file_infos = OC_Files::getFileInfo($file_path);
        $token = '';
        // is the file allready shared ?
        $shares = OCP\Share::getItemShared('file', $file_infos['id'], OCP\Share::FORMAT_NONE, null, true);
        foreach ($shares as $share) {
            if ($share['path'] == $file_infos['path']) {
                $token = $share['token'];
开发者ID:silvioheinze,项目名称:user_wordpress,代码行数:31,代码来源:wordav.php


注:本文中的OC_APP::getAppPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。